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.
What AST is for
Section titled “What AST is for”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
Important: variables are not built in
Section titled “Important: variables are not built in”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:
%(#wins *(%(#wins) + 1))"$(user) now has %(#wins) wins!"Start here
Section titled “Start here”This AST section is now split into smaller guides so it is easier to learn.
-
- prefixes
- variables and storage
- arguments
- arrays
- conditionals
- loops
- command references
-
- user and Twitch functions
- moderation and channel actions
- counters, clips, followage
- EventSub, TTS, triggers, chat send
-
AST Execution, Errors & Limits
- how the parser runs
- common errors
- loop and recursion limits
- debugging mindset
-
- best practices
- initialize-or-increment
- guard checks
- user selectors
- full shield systems
Quick mental model
Section titled “Quick mental model”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
Quick example
Section titled “Quick example”This command creates a simple win counter:
*( ^(#wins) ? %(#wins *(%(#wins) + 1)) : %(#wins 1) )"$(user) has %(#wins) wins!"What it does:
- checks if
#winsexists - if yes, increments it
- if no, creates it with
1 - prints the updated total
Plan-aware features
Section titled “Plan-aware features”Some AST features depend on the streamer’s plan.
| Feature | Free | Premium | Pro |
|---|---|---|---|
| Memory variables | Yes | Yes | Yes |
Cache variables (#, ##) | Yes | Yes | Yes |
Database variables (*, **) | No | Yes | Yes |
| Deeper loops | Limited | More | Most |
| AI voice / cloned voice features | Yes | Yes | Yes |
Recommended workflow
Section titled “Recommended workflow”- Start with a plain text response
- Add arguments like
&p1 - Add functions like
$(user)or$(twitch.game) - Add variables only when you need state
- Add conditionals and loops last