OverlayThing Docs
Home
Login / Request Access
01 Get started
Introduction Quickstart Add to your stream
02 Overlays
Overlays The editor Overlay URLs Alert queue Share, export & import
02.1 Widgets
Widgets overview Alerts Variations Hype Train Text to speech Goals Countdown & subathon Chat box Data labels Counter Text, image & video
03 Chatbot
Chatbot overview Getting started Commands Variables Conditionals Recipes API commands Integrations Command API & Copy-URL Chat moderation Bot settings
03.1 Chatbot modules
Modules overview Timers Counters Quotes Chat alerts Welcome Giveaways Queue Song requests Loyalty
04 Remote Control
Overview Connect OBS Studio Connect Meld Studio Bindings & triggers Security & access
05 Monetize
Tip page Tip settings Merch with Fourthwall
06 Build your own
AI Magic Builder Custom widgets Widget SDK
07 Your data
Dashboard Stream data Chat log Moderation
08 Account
Settings & connections Export your data Import from StreamElements
09 Reference
Label tokens Keyboard shortcuts Troubleshooting
Chatbot/Conditionals
Chatbot

Conditionals.

Conditionals let one command react differently to different viewers and situations: greet a sub one way and everyone else another, hide mod tools from regular chat, or roll a chance-based reply, all in a single response.

The block form

Wrap part of a response in an $(if …) block. The bot evaluates the condition and posts only the branch that matches. An $(else) is optional, and every block ends with $(endif).

responseshape
$(if CONDITION)shown when true$(else)shown when false$(endif)

Blocks can nest, so an $(else) branch can hold another $(if …) for a chain of cases.

Writing the condition

A condition is a boolean expression. Combine smaller checks with and, or and not, and group with parentheses. Precedence runs not first, then and, then or, so subscribed and tier >= 2 or mod reads as "(subscribed and tier 2+) or mod". Use parentheses any time you want a different grouping.

conditiongrouping
subscribed and (tier >= 2 or mod)

Comparisons

Either side of a comparison can be a token like $(followers), a named operand like tier, a number, or a "quoted string". Text values must be quoted. Equality is == (a lone = is accepted as a friendly alias), inequality is !=, and the numeric comparisons are >, >=, < and <=. String comparisons are case-insensitive, so "Just Chatting" and "just chatting" match.

Truthiness: a bare operand with no comparison is true when it is a true flag, a non-zero number, or a non-empty string that is not 0 or false. Coercion: when both sides of a comparison look like numbers they compare as numbers, otherwise they compare as text, so $(count) > 100 works even though tokens arrive as strings.

What you can check

Conditions can read viewer status (subscribed, tier, mod, vip, follower, first_time), channel state (live, hour, uptime), and any $( … ) variable. The full list of named operands, with each one's type and meaning, appears in the Conditionals section of the variable reference.

Examples

Start simple. Compare a token to text (the = alias is shown here) to greet one specific viewer:

responsegreet by name
$(if $(user) = "ninja")the king has arrived 👑$(else)welcome $(user)!$(endif)

Check a viewer's tier exactly, with a nested fallback for any other sub:

responsetier 3
$(if tier == 3)Tier 3 legend, thank you!$(else)$(if subscribed)thanks for subbing!$(else)hi $(user)$(endif)$(endif)

Compare one token against another, here a shouted-out channel's follower count against your own:

responsetoken vs token
$(if $(touser.followers) > $(followers))$(touser) is bigger than us, go follow!$(else)show $(touser) some love$(endif)

Match the current category by name:

responsecategory
$(if $(game) == "Just Chatting")grab a seat and chat!$(endif)

Reward loyal subs, and nudge everyone else:

responseloyal sub
hi $(user), $(if subscribed)because you're a loyal sub you get priority!$(else)if you were subbed you'd have a much better chance!$(endif)

Unlock a perk for Tier 2 and above:

responsetiered perk
$(if tier >= 2)Tier 2+ perk unlocked for $(user)!$(endif)

Welcome a first-time chatter:

responsefirst timer
$(if first_time)Welcome to the stream, $(user)! 🎉$(else)wb $(user)$(endif)

Show a hint only your mods can see:

responsemod only
$(if mod)Mod tools: !timeout !clip !title$(endif)

Run a free, no-API jackpot that hits roughly ten percent of the time:

responsechance
$(if $(random 1-100) <= 10)💰 JACKPOT $(user)!$(else)no luck, try again$(endif)

Greet by time of day:

responsetime of day
$(if hour >= 18)Good evening$(else)Good day$(endif), $(user)!

Gate a reply on whether you are live:

responselive gated
$(if live)We're live for $(uptime)!$(else)Currently offline, see you next stream.$(endif)

Combine several checks in one condition:

responsecombined
$(if subscribed and tier >= 2 or mod)VIP lane$(else)standard queue$(endif)
The un-taken branch never runs

Only the matching branch is evaluated, so tokens in the other branch are never resolved. That makes it safe to put a costly $(api) call or a League $(lol.rank …) lookup inside a branch: it only fires when that branch is the one being posted.

Previous Variables Next Recipes
On this page
Ask the docs
Have a question?
Thinking it through...
Answer
Get an answer instantly; our model is trained on every feature of our streaming suite.
ESC
Get started
More than overlaysOverlayThing is an all-in-one toolkit for your Twitch channel: a visual overlay … Get started From zero to liveThe fastest path to a working overlay on your stream. Sign in, build something, … Get started Add to your streamOne overlay, one URL, one browser source. OverlayThing works with any streaming … Get started
Overlays
OverlaysYour overlays live on the Overlays page, a gallery of every canvas you have buil… Overlays The editorWhere overlays are built. A canvas in the middle, your layer stack on the left, … Overlays Overlay URLsEach overlay has its own private URL. Add it to your streaming software once and… Overlays Alert queueWhen events pile up (a gifted-sub train, a hype raid), you usually want alerts t… Overlays Share, export & importMove overlays and individual widgets between your own overlays, back them up as … Overlays
Widgets
Widgets overviewWidgets are the building blocks of an overlay. Some fire on an event and leave (… Widgets AlertsThe moment something happens, an alert fires on screen with motion, sound and yo… Widgets VariationsOne event, different reactions. Variations let a single alert play a bigger vers… Widgets Hype TrainWhen a Hype Train rolls on your channel, OverlayThing can fire an on-screen aler… Widgets Text to speechHave alerts read messages aloud: a tip note, a resub message, a redemption. Text… Widgets GoalsA progress bar with a target. It fills itself as events come in, and you can cel… Widgets Countdown & subathonTwo timer widgets. A countdown runs down to a time or for a set duration. A suba… Widgets Chat boxPut your Twitch chat on stream, great for handheld, IRL or face-cam layouts wher… Widgets Data labelsSmall live readouts that keep your channel numbers on screen: latest follower, l… Widgets CounterPut a live number on your overlay: deaths, wins, fails, anything you keep a runn… Widgets Text, image & videoThe plain building blocks. Use them for backgrounds, frames, logos, panels and l… Widgets
Chatbot
The chatbotA Twitch chat bot built into OverlayThing: custom commands, timers, counters, qu… Chatbot Getting startedTurn the bot on, make it a moderator, and pick your command prefix. Three small … Chatbot CommandsCommands are the heart of the bot. A viewer types a trigger, the bot replies wit… Chatbot VariablesVariables are $( … ) tokens you drop into a command response. They fill in with … Chatbot ConditionalsConditionals let one command react differently to different viewers and situatio… Chatbot RecipesCopy-ready command responses for the trickier variables: shoutouts, weather, dic… Chatbot API commandsPower-user territory. Wire a command to an external API and pull a live value in… Chatbot IntegrationsBuilt-in connections to outside services that add ready-made variables. Today th… Chatbot Command API & Copy-URLFire bot commands and module actions from outside chat: a Stream Deck button, a … Chatbot Chat moderationWhen the bot is a moderator it can keep chat clean automatically: tunable spam f… Chatbot Bot settingsThe channel-wide behavior of the bot: your prefix, how it replies, how cooldowns… Chatbot
Chatbot modules
ModulesThe bot is built from modules you switch on one at a time. Turn on only what you… Chatbot modules TimersPost recurring messages on a schedule: rules, your socials, a sponsor plug. Time… Chatbot modules CountersTrack a number from chat: deaths, wins, fails, anything you want to tally live.… Chatbot modules QuotesA searchable quote book your chat builds with you, one memorable line at a time.… Chatbot modules Chat alertsPost a chat message when someone follows, subscribes, resubs, gifts, cheers or r… Chatbot modules WelcomeGreet people automatically: first-time chatters, returning regulars, and incomin… Chatbot modules GiveawaysRun a giveaway and draw a winner from chat, by keyword entry or passive presence… Chatbot modules QueueLet viewers line up to play with you. They join, you pull people up in order.… Chatbot modules Song requestsViewers request YouTube songs by name or link and the bot builds a play queue, w… Chatbot modules LoyaltyTrack how long your viewers watch, so you can spot and reward your most loyal re… Chatbot modules
Remote Control
Remote ControlDrive your local OBS Studio or Meld Studio straight from OverlayThing. Switch sc… Remote Control Connect OBS StudioAdd the Remote Control URL as a dock or browser source, enable the OBS WebSocket… Remote Control Connect Meld StudioAdd the blank Remote Control source to every Meld scene. There is no password to… Remote Control Bindings & triggersA binding is one or more actions plus the trigger that fires them. Build them on… Remote Control Security & accessThe Remote Control URL is a key to your streaming software, and your OBS passwor… Remote Control
Monetize
Your tip pageA branded donation page viewers can reach from a single link in your panels or c… Monetize Tip settingsEverything behind your tip page: the payment connection, your branding, the amou… Monetize Merch with FourthwallConnect your Fourthwall shop and merch sales fire alerts on stream, the same way… Monetize
Build your own
AI Magic BuilderDescribe the widget you want in plain language and OverlayThing builds a styled,… Build your own Custom widgetsFor when you want to break the mold. Write your own HTML, CSS and JavaScript, re… Build your own Widget SDKThe API your custom widgets use to receive live events and persist state. It is … Build your own
Your data
DashboardYour home base. The numbers that matter at a glance, a chart to spot trends, and… Your data Stream dataThe numbers behind your overlay. Labels, goals and leaderboards all read from he… Your data Chat logA searchable archive of your chat, events and moderation actions. Look up what a… Your data ModerationEvery chat message, tip note and alert message runs through a moderation pipelin… Your data
Account
Settings & connectionsYour account, your connected services, and the controls that protect your access… Account Export your dataYour data is yours. From Settings, under Data and privacy, you can take it with … Account Import from StreamElementsAlready set up elsewhere? Bring your overlays, alert settings, goals and history… Account
Reference
Label tokensTokens are {placeholders} you drop into alert text, label templates and goal lab… Reference Keyboard shortcutsThe editor is built for the keyboard. These are the ones worth learning.… Reference TroubleshootingQuick fixes for the things that trip people up most.… Reference
↑↓ navigate ⏎ open esc close