Automations - Overview
Automations lets you build rules of the form "when this happens, if these conditions hold, do these things". A rule can give a role to new members, delete invite links and warn the author, post a reminder every Friday, respond to spam the Moderation module detects, or lock channels when the anti-raid level rises.
The parts of a rule
| Part | What it is | Example |
|---|---|---|
| Trigger | The event that makes the rule run. One per rule | When a message is sent |
| Conditions | Optional checks, in groups combined with AND or OR | Content contains discord.gg/, and the member does NOT have the Moderator role |
| Actions | What the bot does, in order from top to bottom | Delete the message, warn the member, post a log message |
There are 38 triggers, including Discord events (messages and their edits, joins, reactions, voice, threads, roles), moderation events (warns, timeouts, kicks, bans, unbans, notes), the Moderation module's spam detectors (or a spam rule's own threshold) and anti-raid level changes, level-ups from the Levels module, and time schedules. Each trigger offers only the conditions and actions that make sense for it; the Triggers Reference lists them.
How rules run
- An event happens, for example a message is sent.
- The bot takes the enabled rules for that trigger, in Rule order (lowest first).
- A rule whose options leave the event out is skipped: an edited message without Also check edited messages, another bot's or a webhook's message without Include bots and webhooks, the bot's own message or event without Include the bot's own events, or a staff or automatic moderation action the rule is not for.
- For each remaining rule it checks the conditions. If they fail, the rule is skipped.
- A rule on cooldown, or one that already ran its maximum number of times for this member, is skipped.
- Otherwise the actions run one after another. An action that fails (for example the bot lacks a permission) is skipped and the rest still run.
- If the rule ran and has Allow further rules turned off, no later rules run for this event. For a message, that includes its spam rules: after a When a message is sent rule stops, no spam rule runs for that message, and after a spam rule stops, no later spam trigger does (see Spam triggers).
Rules are processed only while the module is on (the switch at the top of the panel, or /automations enable and /automations disable). To see how the rules would treat a message without running them, use /automations debug.
Note
Limits. Each server can run at most 30 rules per minute; once the limit is reached, further rules are skipped until the minute has passed. Rules that set each other off directly (a rule's warning or timeout runs the moderation rules, which may act again) are cut off after two such rounds. An event that comes back from Discord (giving a role fires When a member changes, for example) starts a new chain, held back only by cooldowns and the per-minute limit. A message a rule posts never runs a rule, even one with Include the bot's own events, so an auto-reply cannot answer itself.
Pages in this guide
| Page | What it covers |
|---|---|
| Setup | Building your first rule, step by step |
| Triggers Reference | Every trigger, schedules, and what each trigger allows |
| Conditions Reference | Every condition, groups and NOT |
| Actions Reference | Every action and its settings |
| Examples | Ready-made rules for common tasks |
| Commands | The /automations commands |
| Settings | Rule settings, cooldowns, limits and the Logs tab |
| Variables | Variables for messages, DMs and nicknames sent by actions |
| Troubleshooting | Rules that do not fire, or fire too often |