Generate Text
Runs on: Shared (backend or chatbox overlay).
Builds text from a template with numbered placeholders {{0}}, {{1}}, {{2}} and so on. Each placeholder is replaced by the value on the input of the same number. Inputs are added as you add placeholders.
Inputs
| Name | Type | Description |
|---|---|---|
0 | any | The value for {{0}}. |
1 | any | The value for {{1}}. |
... | any | One more input for each additional placeholder. |
Outputs
| Name | Type | Description |
|---|---|---|
Text | string | The text with all placeholders replaced. |
Configuration
- Template: The text, with
{{0}},{{1}},{{2}}and so on marking where each input goes.
Functions
Templates can call Functions, the same $(functionName …) commands available in overlay widgets. Functions run after placeholders are replaced, so they can use your inputs:
Thanks for the $(formatNumber {{0}}) bits!
This adds thousands separators to the bits amount. See the Functions reference for the full list.
Example
For "Thanks for the 500 bits, NightBot! You rock!", set the template to Thanks for the {{0}} bits, {{1}}! You rock!. Connect the cheer event's bits to input 0 and the viewer's displayName to input 1.