Browse Tutorials

Tutorials

Variables Reference

Trophy Case uses Condition Variables to decide whether an achievement can award a trophy and Chat Response Variables to insert text into the response after a successful award. These two sets are not interchangeable. Variable names are case-sensitive.

Condition Variables

To add a variable condition, choose Variable, then select the variable, comparison, and value. All condition rows must pass for the achievement to award a trophy.

Variable What it provides
$username Twitch username of the person who triggered the event or command.
$targetusername Twitch username of the person receiving the trophy. For self-awards, this is the same as $username.
$userrole The triggering user’s role in the channel: streamer, moderator, VIP, subscriber, follower, or viewer. A person can have multiple roles.
$targetrole The trophy recipient’s role in the channel, using the same roles as $userrole.
$message The complete chat message that triggered the event, preserving its original text.
$dateyear Year of the event, such as 2026.
$datemonth Month of the event, from 1 to 12.
$dateday Day of the month, from 1 to 31.
$dateweek Day of the week as lowercase English text, such as monday.
$yearday Day of the year, starting at 1 on January 1. Maximum is 365, or 366 during leap years.
$hour Hour of the event in 24-hour time, from 0 to 23.
$minute Minute of the event, from 0 to 59.
$bitsamount Number of Bits used in that event, not the user’s lifetime total.
$subtier Subscription tier: 1, 2, or 3. Prime counts as Tier 1 when reported as such by Twitch.
$submonths Total subscribed months reported with the subscription event, not consecutive months. Only available when that event includes the information.
$giftamount Number of subscriptions gifted in a gift-sending event, not lifetime gifts.
$raidviewers Number of viewers reported in the incoming raid.
$category Current stream game/category name.
$streamtitle Current stream title.
$streamtags Current stream tags, treated as separate list entries.
$hypelevel Hype Train level reported in the triggering event.
$rewardname Title of the Channel Points reward that was redeemed.

Availability and comparison behavior

  • Missing event information: Event-specific variables are available only when the relevant event provides them. Missing information is not treated as zero, false, or an empty string; the condition does not pass.
  • Date and time: Date and time variables use the time zone saved with the achievement.
  • Usernames: Usernames do not include @.
  • Role and tag lists: Comparisons check whole list entries. Equals/Contains means the list includes that entry; Not equals/Does not contain means it does not.
  • Viewer role: In the current app, viewer means someone who is not the streamer, moderator, VIP, subscriber, or follower.
  • Role permissions: Moderator/VIP lookups require the streamer to grant the app’s role-reading permissions.
  • Hype Train events: These may have no triggering username. Use $targetusername to refer to the recipient.

Chat Response Variables

These variables substitute text into the achievement’s chat response after a successful award. Only the variables in this table are available in chat responses; the additional condition variables are not.

Variable What it provides
$username Username of the command caller or event actor. For Hype Train award responses, this uses the recipient.
$targetusername Verified username of the trophy recipient.
$trophyname Name of the trophy awarded.
$trophyserial Recipient’s serial number for that trophy, without a # prefix.
$trophyslug Trophy’s identifying code/slug, not its display name or UUID.
$trophycreator Username of the streamer awarding the trophy, not the bot or command caller.
$trophyowner Username of the trophy recipient; the same value as $targetusername.

Example chat response

Congratulations @$targetusername! You received $trophyname #$trophyserial!

The @ and # in this example are literal text added around the substituted values.