Skip to content
TipPage Docs
Esc
navigateopen⌘Jpreview
On this page

Variables

Everything that can go inside {curly braces} in a command response, timer message or announcement - and how to combine them.

Anywhere the bot speaks - custom commands, timers, announcements - you write the message once and the bot fills in the blanks. A blank is a variable: a name in curly braces, sometimes with an argument after a colon.

{user}                a name, no argument
{random:1-100}        a name with an argument
{repeat:3|Kappa}      arguments with several parts use | between them

Variable names aren’t case-sensitive. Anything the bot doesn’t recognise is left exactly as you typed it.

Variables nest

An argument can contain other variables. The bot works from the inside out, so this does what it looks like:

!coinflip  →  {user} flipped a coin: {if:{random:0-1}==1|heads|tails}

{random:0-1} becomes 0 or 1 first, then {if:} looks at the result. Anything you can build from smaller pieces, you can put inside a bigger one - {ai:...} prompts, {urlfetch:} URLs, {repeat:} counts, all of it.

Viewer text is never code

{args}, {arg:N} and {touser} carry text a viewer typed. That text is treated as data: if someone types {pick:/ban|x} at your bot, the bot echoes their curly braces back rather than running them - even when their text ends up inside an {if:} condition or an {ai:} prompt. The same goes for anything fetched from outside ({urlfetch:}, {ai:} replies). You can nest freely without worrying about what chat will type.

Twitch and Kick

Every variable works in both chats unless a page says otherwise. The ones that read the chat itself ({user}, {args}, {msgid}, …) use whichever platform the message came from; the stream ones ({uptime}, {game}, …) read the channel the message came from and take a twitch: / kick: argument to read the other. The exceptions, all because Kick has no API for them:

Variable Twitch Kick
{accountage} Yes Blank
{emote} / {emotes} Yes Blank
{bttv} / {ffz} Yes Blank - both are Twitch-only products
{7tv} Yes Yes - 7TV serves Kick channels too
{user.*} (messages, tipped, rank, last_seen, …) Yes Yes - chat stats are counted per platform and tips follow the viewer’s linked accounts
{followage} Yes Yes - best-effort, may read blank if Kick’s lookup is unavailable

All variables

Who and what

Variable Becomes
{user} The person who ran the command - plus {user.messages}, {user.tipped}, {user.rank}, {user.last_seen} and more
{touser} Who the command is aimed at - the first word typed, or the user if nothing was
{channel} Your channel name
{platform} twitch or kick - where the message is running
{args} Everything the viewer typed after the command
{arg:N} The Nth word they typed
{msgid} The platform’s id for the message that triggered the command

Randomness

Variable Becomes
{pick:a|b|c} One of the options
{list:name} A random line from a response list
{random:1-100} A random whole number in the range

Logic and text

Variable Becomes
{if:a==b|yes|no} One of two texts, depending on a comparison
{repeat:3|text} The text repeated
{upper:text} / {lower:text} The text in capitals / lowercase
{queryescape:text} / {pathescape:text} The text made safe for a URL

Your stream

Variable Becomes
{uptime} How long you’ve been live
{title} Your stream title
{game} The category you’re streaming
{viewers} Your current viewer count
{emote} / {emotes} A random channel emote / all of them (Twitch only)
{7tv} / {bttv} / {ffz} A random 7TV / BetterTTV / FrankerFaceZ emote - plus .list and .count, and any emote set you point them at
{followage} How long someone has followed you
{accountage} How old someone’s Twitch account is (Twitch only)

Your tips and queues

Variable Becomes
{tips.today}, {tips.month}, {tips.total}, … Tip totals, the latest tip, your top supporter, your minimum and maximum tip
{tip_page} Your tip page address
{tts.queue}, {media.queue}, {media.now} What’s queued and what’s playing

Counters, the web, and AI

Variable Becomes
{count} / {counter:name} A counter that bumps on every use / a counter’s current value
{urlfetch:https://...} Whatever text that URL returns
{ai:prompt} A one-line reply from an AI model

The stream and counters / web / AI groups fetch live data, so a response using them takes a beat longer to appear - usually well under a second, a couple of seconds for {ai:}.

Was this page helpful?