Skip to content

Advanced Custom Commands (AST)

DomDimaBot’s AST parser is the advanced layer behind custom commands. It lets you build commands that can store values, run logic, call functions, reuse other commands, and react differently based on context.

Use AST when you want your command to do more than send fixed text.

  • save counters and user progress
  • build dynamic replies
  • run conditionals like if / else logic
  • work with arrays and loops
  • call Twitch, moderation, TTS, trigger, and EventSub functions
  • chain commands together

DomDimaBot does not give you default AST variables automatically.

  • Variables are user-created with %(...)
  • If you want to store a value, you create that variable yourself
  • Context data usually comes from functions like $(user), $(twitch.game), or from arguments like &p1

Example:

Terminal window
%(#wins *(%(#wins) + 1))
"$(user) now has %(#wins) wins!"

This AST section is now split into smaller guides so it is easier to learn.

  1. AST Syntax & Data

    • prefixes
    • variables and storage
    • arguments
    • arrays
    • conditionals
    • loops
    • command references
  2. AST Functions Reference

    • user and Twitch functions
    • moderation and channel actions
    • counters, clips, followage
    • EventSub, TTS, triggers, chat send
  3. AST Execution, Errors & Limits

    • how the parser runs
    • common errors
    • loop and recursion limits
    • debugging mindset
  4. AST Recipes & Patterns

    • best practices
    • initialize-or-increment
    • guard checks
    • user selectors
    • full shield systems

Think of AST commands as small scripts inside a custom command.

  • %(...) = read or write your own variables
  • $(...) = call a function
  • *(...) = compute logic
  • ^(...) = check whether something exists
  • #(...) = run another command from this command

This command creates a simple win counter:

Terminal window
*( ^(#wins) ? %(#wins *(%(#wins) + 1)) : %(#wins 1) )
"$(user) has %(#wins) wins!"

What it does:

  1. checks if #wins exists
  2. if yes, increments it
  3. if no, creates it with 1
  4. prints the updated total

Some AST features depend on the streamer’s plan.

FeatureFreePremiumPro
Memory variablesYesYesYes
Cache variables (#, ##)YesYesYes
Database variables (*, **)NoYesYes
Deeper loopsLimitedMoreMost
AI voice / cloned voice featuresYesYesYes
  1. Start with a plain text response
  2. Add arguments like &p1
  3. Add functions like $(user) or $(twitch.game)
  4. Add variables only when you need state
  5. Add conditionals and loops last