Skip to content

AST Functions Reference

Functions are called with $(...).

Terminal window
$(user)
$(random 10)
$(twitch.game)
FunctionDescriptionUsage
$(user)Current chatter’s username$(user)
$(touser)Target user from context$(touser)
$(randomuser)Random chatter in channel$(randomuser)
FunctionDescriptionUsage
$(random N)Random integer from 0 to N-1$(random 10)
$(random)Random integer using the default range$(random)
FunctionDescriptionUsage
$(upper text)Uppercases the text$(upper hello)HELLO
$(lower text)Lowercases the text$(lower HELLO)hello
$(title text)Capitalizes each word$(title hello world)Hello World
$(capitalize text)Capitalizes only the first letter$(capitalize hello)Hello
$(trim text)Removes surrounding whitespace$(trim " hi ")hi
$(length text)Length of the text$(length hello)5
$(slice start [end] text)Cuts text by position; negatives wrap from the end$(slice 0 5 hello world)hello
$(replace search replacement text)Replaces every occurrence (literal, no regex)$(replace o 0 foo)f00

For multi-word search or replacement values, use quotes: $(replace "old text" "new text" the old text here).

FunctionDescriptionUsage
$(twitch.subs)Subscriber count$(twitch.subs)
$(twitch.title)Stream title$(twitch.title)
$(twitch.game)Current category$(twitch.game)
$(twitch.viewers)Viewer count / chatters$(twitch.viewers)
$(twitch.follows)Follower count$(twitch.follows)
$(twitch.channel)Broadcaster name$(twitch.channel)
$(twitch.login)Broadcaster login$(twitch.login)
FunctionDescriptionArgsLevel
$(vip) or $(add.vip)Add VIPusername [days]Mod
$(unvip)Remove VIPusernameMod
$(ban)Ban or timeout userusername [duration_seconds]Mod
$(ban.mod)Ban and optionally restore mod`username seconds truefalse`
$(mod) or $(add.mod)Add moderatorusername [days]Owner
$(unmod)Remove moderatorusernameOwner
$(clear.chat)Clear chatnoneMod
$(emoteonly)Toggle emote-only mode[duration_seconds]Mod
$(bot.mode attack)Manually activate Follow Defense Attack ModenoneMod
$(bot.mode status)Show current Follow Defense modenoneMod

Temporary mod and VIP durations from 1 to 365 days require Premium or Pro.

FunctionDescriptionUsage
$(raid channel)Raid target channel$(raid targetchannel)
$(unraid)Cancel raid$(unraid)
$(set.title new_title)Update stream title$(set.title Playing Valorant!)
$(set.game game_name)Update category$(set.game Valorant)
$(start.prediction title;opt1/opt2;seconds)Start prediction$(start.prediction Who wins?;A/B;120)
$(start.poll title;opt1/opt2;seconds)Start poll$(start.poll Favorite game?;COD/Halo;60)
$(ad)Ad duration in seconds$(ad)
$(ad.time)Ad duration in seconds$(ad.time)
$(ai prompt)AI-generated response$(ai tell a joke)
FunctionDescriptionUsage
$(count N)Read current count and optionally add N$(count 5)
$(count 0)Read count without changing it$(count 0)
$(count -3)Subtract from the count$(count -3)
$(scount)Simple +1 increment$(scount)
$(bits)Bits from a cheer event$(bits)
FunctionDescriptionUsage
$(create.clip)Create a clip and return the URL$(create.clip)
FunctionDescriptionUsage
$(followage username)Return how long a user has followed$(followage ronni)

These only return useful data when the command is triggered by the matching EventSub event.

FunctionEvent ContextReturns
$(raid.channel)channel.raidRaiding channel display name
$(raid.login)channel.raidRaiding channel login
$(raid.viewers)channel.raidNumber of raid viewers
$(cheer.amount)channel.cheerBits cheered
$(cheer.message)channel.cheerCheer message text
$(sub.tier)channel.subscribePrime / Tier 1 / Tier 2 / Tier 3
$(sub.months)channel.subscribeCumulative months
$(gifted.user)channel.giftGift recipient username
$(hypetrain.progress)hypetrain.eventProgress toward goal
$(hypetrain.level)hypetrain.eventCurrent level
$(hypetrain.end)hypetrain.eventEnd timestamp
$(shoutout.channel)channel.shoutoutChannel that was shouted out
$(reward.input)channel.points_redemptionUser redemption input
$(redemption.input)channel.points_redemptionUser redemption input
$(ad)channel.ad_breakAd duration
FunctionPlanDescriptionUsage
$(tts message)AllQueue default TTS$(tts Hello world)
$(tts.speak message)AllSame as $(tts ...)$(tts.speak Hello)
$(tts.ai message)AllSame as $(tts ...)$(tts.ai Hello world)
$(tts.clone name message)AllVoice clone TTS$(tts.clone voice1 Hello)
FunctionDescriptionUsage
$(trigger.send name)Fire a trigger$(trigger.send airhorn)
$(trigger.send name true)Fire a queued trigger$(trigger.send airhorn true)
FunctionDescriptionUsage
$(delay N)Pause for N seconds, max 60$(delay 5)
$(break)Exit a loop early$(break)
$(continue)Skip the current loop iteration$(continue)
$(chat.send message)Send a message to chat$(chat.send Hello everyone!)
FunctionExample UsageExample Output
$(user)"Welcome $(user)!"Welcome ronchi!
$(random 20)"You rolled: $(random 20)"You rolled: 7
$(twitch.subs)"We have $(twitch.subs) subscribers!"We have 1542 subscribers!
$(count 1)"Uses: $(count 1)"Uses: 42
$(followage ronchi)"$(user) has followed for $(followage ronchi)"ronchi has followed for 1 year...
$(create.clip)"Clip: $(create.clip)"Clip: https://clips.twitch.tv/...
$(trigger.send airhorn)"$(trigger.send airhorn)"Trigger fires
$(chat.send Hello everyone!)"$(chat.send Hello everyone!)"Message sent