Skip to content

Every reply box in the dashboard takes a template: a command’s Reply, an event response’s Your line, a timer’s Messages. A template is your own words, with helpers in braces where a value changes. When the reply runs, the bot swaps each helper for its value, and everything outside the braces goes out exactly as you typed it.

For example, put this in a command’s Reply field:

Welcome {user}! Today we play {stream.game}.

When Example_Viewer uses the command while the category is Just Chatting, the bot types “Welcome Example_Viewer! Today we play Just Chatting.” The next viewer gets their own name, and a new category shows the next time the reply runs.

Before you start

You need a command that sends a reply. If you have none yet, make one first on Create a command.

Try a helper

  1. Open Commands in the sidebar. The Channel commands tab opens first.
  2. Choose your command in the list. Search commands above the list finds it by name. The command’s editor opens, with the Reply field.
  3. In Reply, add {user} where your name should go.
  4. Choose Save changes at the right of the footer.
  5. In your Twitch chat, type the command’s trigger, such as !hello. The bot’s reply shows your name where you typed {user}.

Leave the other helpers alone until that works. The event response and timer editors save the same way, with Save changes in their footer.

Literal text and helpers

Only the part inside braces is a helper. Now playing: {stream.game} keeps your label and fills in the category. {Now playing} asks for a helper named Now playing, which does not exist, so the save is refused.

Braces that never close, empty braces {} and a stray } with no { before it stay in the line as plain text. To type a brace as itself, put a backslash before it, such as \{. The same works for the pipe, the colon and the backslash.

Give a helper its input

Some helpers only read a value, such as {user}. Others take input from you, such as {text.upper:hello}, which gives HELLO. A helper name can hold dots, and the first colon ends it. The text after that colon is the input, and a pipe separates one input from the next.

What a helper does with its input depends on the helper. Most helpers work on it, like text.upper above. A numbered command word such as {args.1} uses it as a fallback for a word that was not typed, as shown under When a value is missing.

You writeWhat it does
{if:value|then|else}Shows the then text when the value is set, and the else text when it is not. A value is not set when it is empty, false, no or 0.
{default:value|fallback}Shows the value, or the fallback when the value is empty.
{set:name=value}Keeps a value for the rest of the reply and prints nothing. Read it back with {var.name}.

A helper can hold another helper, and the inner one is filled in first. For example, {if:{stream.isLive}|We are live|We are offline} shows We are live while the stream is live and We are offline when it is not.

{set:mood=happy}I feel {var.mood}. shows I feel happy. A name for set has letters, digits and underscores, and starts with a letter or an underscore. The value lasts for that one reply only.

Spaces in a helper’s input count. Text that a helper prints keeps every space as you typed it, so {text.repeat:3|ha } gives ha ha ha . An input that a helper reads as a number, a count or a name ignores the spaces around it, so {text.repeat: 3 |ha} gives hahaha.

Inside a helper’s input, \s gives a space and \n starts a new line. A plain space works too. Use \s when a space at the start or end of an input would be hard to see in the box, such as {text.repeat:3|rofl\s}.

Choose a helper that works where the reply runs

A timer runs on a schedule, so it has no person and no chat message, and {user} does not work in one. A chat command has a person who typed it and the words after the command. An event response has the values of its event, such as the tier of a sub, but no command words.

Each reply box knows its place: type { and it suggests only the helpers that work there.

  • The command, timer, chat trigger, pipeline step, reward and webhook boxes have Show all helpers in the label row. It opens the full list for that place, with an example for each helper.
  • The event response box has no Show all helpers. Instead, the info icon beside Your line reads “You can use:” and names the values the chosen event carries.
  • In a Discord notification, the Message box and the embed’s Description box have Show all helpers. The other embed boxes, such as Title and Footer, have none. Type { there for suggestions.

Viewer text is a viewer’s own words, such as a reward input or the words after a command. The bot fills in helpers in viewer text only while Viewer Templates is on and the viewer holds the template permission.

  • Viewer Templates is in Features, in the Chat group. It is on by default.
  • Subscribers and higher hold the template permission by default. To change who holds it, open Settings, then Permissions, then the Actions tab, and type template in Search actions. The action is in the Rewards area. To give it to one person, use the Per person tab.

Most places have the shared helpers: the channel, stream, time, random, counter and list helpers.

PlaceWhat it has
CommandsThe person who used the command, the words after the command, and the shared helpers.
Event responsesThe values of the event that fired it (for example a follow, a sub, a cheer, a raid, a poll, a prediction, a hype train, an ad break, a ban or the stream going online), the person behind it, and the shared helpers. No command words.
TimersThe shared helpers. No person, no chat message and no command words.
Pipeline stepsThe helpers of the trigger the pipeline runs from: a command, an event or a timer.
Discord notificationsThe shared helpers, the values of the event that sent the post, and some helpers that only Discord has. Of the person helpers, only {user}, {user.name} and {user.id} work. No other user. helpers, no target. helpers, no {name} and no command words.
Webhook bodiesThe person helpers, the @target helpers and the shared helpers. No command words.
Viewer textText helpers and read-only channel and viewer helpers. Nothing that changes data.

The channel helpers that work everywhere, viewer text included, are {channel} and {channel.display}. {channel.id} works in every place except viewer text. Some helpers with a similar name work only in Discord notifications: {channel.name}, {channel.login}, {channel.title}, {channel.game}, {channel.url}, {channel.avatar}, {stream.url} and {stream.thumbnail}. In a command reply, the save refuses them.

Copy a helper from one place to another

Check a helper before you move it, because a helper from an event response often needs that event. When the save refuses a helper that works somewhere else, the message always has three parts in the same order:

  1. It starts with the helper and the place, such as “‘{args.1}’ is not available in event responses”.
  2. Then it gives the reason after “because”, such as “because it needs a chat command, and only commands and pipelines carry one”.
  3. It ends with the places where the helper works, after “It works in:”, such as “It works in: commands, pipelines”.

So {args.1} in an event response gives: “‘{args.1}’ is not available in event responses because it needs a chat command, and only commands and pipelines carry one. It works in: commands, pipelines”. If you paste {gifter} from an event response into a command reply, the message ends with “It works in: event responses, pipelines”.

Warnings while you type and errors on save

The box warns you while you type, and the bot checks again when you save.

MessageWhen it showsWhat it means
“Not a known helper here:” and the namesUnder the box, while you type.This place does not offer that name. It may be misspelled, or it may only work somewhere else.
“is not a recognized template helper”When you save.No helper has that name anywhere.
“is not available in” and a placeWhen you save.The helper exists, but not in this place. The message gives the reason, then the places where it works.

When you see the warning under the box, pick a helper from the box’s own suggestions instead.

When a value is missing

A helper can work in its place and still have no value. A command can be used without the words it expects, and a stream can be offline.

A command word that was not typed stays in the reply as written. Hello {args.1}! gives Hello {args.1}! for a bare !hello. Add a fallback after a colon: Hello {args.1:friend}! gives Hello chat! for !hello chat and Hello friend! for !hello. {args.1:} with nothing after the colon prints nothing.

For any other value that can be empty, wrap it in {default:...|...} or {if:...|...|...} so the line still reads well.

A helper name the bot does not know stays in the line as written. The save check catches most of these first, but it cannot see a name that is built from another helper.

Where a reply goes

Send the reply to sits right below the reply box in the command, event response and timer editors. It decides where the filled-in reply goes.

Send the reply toWhat the bot does with the template
Twitch chatFills it in once, as plain text, and types it in chat.
Chat overlayFills it in for the overlay only.
BothA plain reply: fills it in once and shows the same text in both places. A reply with HTML on: fills it in twice, plain text for chat and HTML for the overlay.
NowhereSends no reply at all. The command or response still runs, and the text you typed stays saved. Choose it to silence a reply for a while without switching the command off or losing its text.

When Both fills a reply in twice, each fill works on its own:

  • A random helper, such as {random.number:6}, draws again for the overlay. Chat and the overlay can show different values.
  • A counter helper, such as {count.deaths}, only reads the counter. The reply does not change it, so both places show the same value.
  • A {set:...} value is kept in each fill on its own. Both places get the same value, unless that value comes from a random helper.

To show the same random value in both places, turn HTML off: a plain reply is filled in once.

The HTML switch is right below Send the reply to. You can turn it on only when the reply goes to Chat overlay or Both. With HTML on, the overlay renders markup such as <b>bold</b>. The name and the words after the command are encoded first, so a < that a viewer types shows as the character < and never opens a tag. The bot also removes unsafe markup before the overlay shows the line.

Names in chat and on the overlay

Twitch pings a person in chat only by their login name. When a display name differs from the login by more than letter case, such as a name in another alphabet, the chat line uses the login. This applies to {user}, {target.name} and {target.displayname} in chat. {user.name} always gives the login.

{name} keeps the display name, in chat too. With no @target, it shows the display name of the person who used the command. With an @target, it shows the target’s display name, or the name as typed when the bot has no display name for that person.

On the overlay, {user} shows the display name, and {target.displayname} shows the target’s display name. To show the display name on the overlay, send the reply to Chat overlay, or to Both with HTML on. A plain Both reply shows the chat text on the overlay too, so it shows the login.

Speech does not use the login either: a reply that is read aloud says the display name, or the pronunciation set for that name.

Find a helper

Template helpers has a page per type of helper, and the type is the first word of the name, such as user, stream, args or text. Each helper has its own row, with what it gives and an example. For a reply that picks a random line from a list you keep, see Pick lists.

Scripts and widgets use the same helpers; see SDK for widgets, actions and templates.

Troubleshooting

When something is not right

Saving fails with “is not a recognized template helper”. The name in braces is not a helper. When a close match exists, the message adds “(did you mean …)”; use that name, or check the spelling on Template helpers.

Saving fails with “is not available in” and a place. The helper exists but does not work here. The message gives the reason after “because”, and the places where it does work after “It works in:”. Pick a helper from this box’s own suggestions instead.

Chat shows a helper in braces, such as {args.1}. The value was missing, or the name was built inside another helper and skipped the save check. Add a fallback after a colon, such as {args.1:friend}, or check the spelling.