Triggers
Triggers are rules that decide when an action should run.
What is a trigger?
Section titled “What is a trigger?”A trigger watches for a specific event from a specific module group. When a matching event arrives, the trigger evaluates a condition — a small JavaScript expression. If it returns true, the linked action executes.
Trigger properties
Section titled “Trigger properties”| Property | Description |
|---|---|
| Module group | Which module group to watch (e.g. twitch) |
| Event name | Which event type to listen for (e.g. ChatMessage) |
| Program | A JavaScript expression that returns true or false |
| Action | The action to run if the condition passes |
| Cooldown | Minimum time between two executions (in milliseconds) |
| Cooldown mode | How the cooldown is applied (optional) |
| Enable | Whether the trigger is active or not |
Writing conditions
Section titled “Writing conditions”The condition is a JavaScript expression with access to:
| Global | Description |
|---|---|
event | The full event object (name, payload, emitter_group, etc.) |
trigger | The trigger object itself |
log(...) | Log values for debugging (visible in process logs) |
Examples
Section titled “Examples”// Always triggertrue// Only when the message starts with "!"event.payload.message.startsWith("!")// Only for a specific userevent.payload.user === "viewer42"// Combine conditionsevent.payload.message.startsWith("!hello") && event.payload.user !== "bot"Cooldown
Section titled “Cooldown”You can set a cooldown on a trigger to prevent it from firing too often. For example, a 5000ms cooldown means the trigger won’t fire again for 5 seconds after the last execution.
One action, many triggers
Section titled “One action, many triggers”An action can have multiple triggers. Each trigger watches for a different event or has different conditions. This lets you reuse the same action for different scenarios.