Helpers on this page: {var.*}, {set}, {custom.*}, {include.*}, {transform.*}.
These helpers keep a value for the rest of a reply, read custom data, or put another command’s reply inside this one. Use them to keep a long reply short.
Reuse a value inside one reply
Use {set:mood=happy}I feel {var.mood}. when you want to name a value once and read it later in the same reply.
The assignment produces no visible text, so the result is I feel happy.
The value can be fixed text or another helper, such as {set:shout={transform.upper:hi}}. The inner helper runs first, and {set} keeps its text.
It lasts only for this rendering; the next command use does not remember it.
Set the value before you read it. A read before the set stays in the reply as written.
A name has letters, digits and underscores, and it starts with a letter or an underscore.
A name that the trigger already supplies is refused, and the {set} stays in the reply as written.
When a helper or a trigger value has the same name, {name} gives that value, not the set one. {var.name} always reads the set value.
For something that should survive another use or a restart, use the relevant stored feature, such as a named counter or viewer data. An include helper is different again: it reads another command’s reply or a list entry so you can reuse wording rather than copy it into several commands. It does not turn a template into a pipeline of actions.
Limits of an include
An include renders the reply text of another command for the same viewer.
It does not run the actions of that command, and it does not check its permission or cooldown.
Values from {set} do not cross into the included reply.
An included reply can include another command, up to 5 levels deep. A command already in the chain is never included again.
When the command has several replies, the include picks one of them.
A missing command, a command with no text reply, or a chain that is too deep stays in the reply as written.
{include.builtin} runs only a built-in command that only reads information and that every viewer may use. Any other key stays as written.
Custom data
A mapped custom field reads the latest value that the bot received for it. The bot keeps that value for 24 hours. A missing source, a missing field and an expired value print as empty.
The examples illustrate possible values; your results depend on the channel and trigger. Use in lists the template fields that accept each helper. A pipeline still needs a trigger that supplies the relevant person, message, or event; event-specific helpers need that event. For viewer-written text, the Viewer Templates setting and permissions also apply.
| Helper | What it gives | Example | Use in |
|---|---|---|---|
{custom.<name>.<field>} | A field from an ingested custom data source (e.g. {custom.mysource.field}) | {custom.heartrate.bpm} gives 128 | Commands, event responses, timers, pipelines, Discord, webhooks |
{include.builtin} | Prints the reply of a built-in command that only reads information any viewer may see, for example uptime: {include.builtin:uptime} | {include.builtin:uptime} gives The stream has been live for 2h 5m. | Commands, event responses, timers, pipelines, Discord, webhooks |
{include.cmd} | Prints the reply of another command of the channel, filled in for the same viewer: {include.cmd:name} | {include.cmd:hug} gives ViewerOne sends a hug | Commands, event responses, timers, pipelines, Discord, webhooks |
{include.list} | Prints one entry of a pick list by its position, counted from 1: {include.list:name|position} | {include.list:snacks|2} gives cookies | Commands, event responses, timers, pipelines, Discord, webhooks |
{set} | Keeps a value under a name for the rest of this reply and prints nothing. Read it with {name} or {var.name}: {set:name=value} | - | Commands, event responses, timers, pipelines, Discord, webhooks |
{transform.<name>:<text>} | Applies one text transform to the wrapped text: upper, lower, title, spaced, alternating, mocking, reverse, trim or truncate. Truncate needs a length, as in {transform.truncate.20:text}, and adds an ellipsis when it cuts. An unknown name prints a [transform error: ...] marker | {transform.upper:hi} gives HI | Commands, event responses, timers, pipelines, Discord, webhooks |
{var.<name>} | Reads a value that {set:name=value} kept earlier in this reply: {var.name} | {set:x=5}{var.x} gives 5 | Commands, event responses, timers, pipelines, Discord, webhooks |
Back to Template helpers. For the places helpers work, special characters and HTML, read Variables and templates.