Automations - Troubleshooting
A rule does not fire
For a message, Test against a message at the top of the Rules tab (paste the message's link) or /automations debug message: lists every message rule and why it would or would not run (see Commands), without running anything; Test this rule in a rule's editor does the same for that one rule. A dry run never looks up an invite the bot has not seen yet and never counts a slow pattern against the rule; it says so when that matters. Otherwise work through this list:
- The module is on (switch at the top of the Automations panel, or
/automations enable). - The rule is enabled (its switch in the list, or
/automations toggle). - The trigger is the event you expect. When a message is sent runs for edited messages only with Also check edited messages on, for other bots' and webhooks' messages only with Include bots and webhooks on, and no rule runs for the bot's own messages and events without Include the bot's own events. A moderation rule may be limited to Staff actions or Automatic actions.
- The conditions pass. Check each group's Match (AND or OR), the Groups must setting and any NOT. Remove conditions one at a time to find the one that fails.
- The rule is not on cooldown (for everyone, for that member or for that channel, by its Cooldown applies to) and has not reached its Max executions per user for that member.
- An earlier rule for the same event has Allow further rules turned off and ran first (see Rule order).
- The server is not over 30 rule runs per minute.
- For spam triggers: a rule on Anti-Spam settings (and Any spam detected) runs only while the Moderation module's Anti-Spam switch and that detector are on, and follows its scope overrides; give the rule its own threshold to run regardless. A spam rule that just fired waits for a new burst from the member, and for its Keep cleaning for window, before it fires again (see Spam triggers).
- For spam triggers on a message, an earlier rule with Allow further rules off (a When a message is sent rule, or a spam rule of an earlier detector) did not stop the spam rules for that message.
A content, link or member condition never matches
- Content matches pattern: a pattern that takes longer than 50 milliseconds on a message is undecided, so the rule does not run (with NOT too), and a bot alert names the rule the first time. A condition that keeps running out of time is paused for a few minutes, with another bot alert; the rule's other conditions keep working. Simplify the pattern (nested repeats such as
(a+)+are the usual cause), or use a word list instead: word lists are plain text lookups and do not run out of time./automations debugsays when a condition was undecided. - Words written in fancy fonts, with accents or split by formatting: turn on Normalize look-alike text or Ignore formatting under Matching options. Leetspeak (
fr33) also needs Read leetspeak. - Link is a known phishing or malware site shows unavailable and never matches until the bot owner sets a FishFish API key (
FISHFISH_API_KEYin the bot'sconfig/.env; it covers every server, and servers cannot add their own). With a key, the list arrives within a few minutes of the bot starting and is refreshed every 6 hours. - Custom status contains text, the Custom status match source and When a member changes their custom status need the presences intent. Without it the bot sees no status at all.
- Links without
https://only count when Only real links is off. - User is bot staff and User is a bot admin follow the staff and admin roles in the server settings; a change there applies to the next event.
A rule matches your own invites or allowed links
Link and invite conditions decide per link and per invite, so one allowed link or ignored invite no longer exempts the rest of the message:
- Put your server's ID under Ignore destination servers, or its invite codes under Ignore invite codes.
- Expired invites, group DM invites and invites past the first three looked up in one message count as a match. Turn on Ignore invites that cannot be checked if they should not.
- For links, list the sites you allow in Allow only listed domains mode, with Include subdomains on for
www.and other subdomains.
A rule cannot be saved
The dashboard refuses a rule whose conditions cannot work, and says which condition and why: a pattern that is not a valid regular expression (with the position of the mistake), a pattern longer than 2000 characters or one that repeats something more than 1000 times (or nests repeats too deeply), more than 1000 words, a word longer than 200 characters or words that add up to more than 20000 characters, a permission Discord does not have, or a duration without a valid unit. Fix the value named in the message and save again.
The rule fires, but an action does nothing
- Permissions: the bot needs the permission for the action (Manage Messages to delete, Manage Roles for roles and permission changes, Moderate Members for timeouts, Kick or Ban Members, Manage Channels for slowmode and locks (and Connect for a voice channel), Manage Threads to archive, lock or delete threads, Create Private Threads for private threads, Manage Nicknames for nicknames), and its role must be above the member's and above any role it gives or edits. In Role permissions mode it can only grant permissions it has itself.
- Nothing to act on: a timeout or kick needs someone who is still a member (a ban does not), Archive the thread needs the message to be in a thread, and the Triggering member target needs an event with a member.
- Missing template: a message action whose template was deleted is skipped, and a bot alert is raised. Pick a new template.
- Deleted role or channel: the bot removes a deleted channel or role from every rule. A message or log action left without its channel posts nothing until you pick another. A rule is turned off when the deleted one was all it named in a Role added or Role removed condition, a slowmode action or a channel permission change, since it would otherwise act on any role or where it fires; pick a new one and turn it back on. Each change is in the module's Logs tab as Disable Rule or Update Rule, with the bot as the actor and what was deleted. Something deleted while the bot was offline stays on the rule: an action naming it fails with "a role it names no longer exists" or "its channel no longer exists". Edit the action.
- No channel: Lock the channel and Unlock the channel act on the channel where the rule was triggered, so triggers without a channel (anti-raid level changes, schedules, joins) have nothing to lock.
- Add infraction points does nothing while the Moderation infraction system is off.
- Send the member a direct message fails when the member has closed their DMs.
The rule's run still counts when at least one action succeeded. Every failed action raises a Bot Alert naming the rule, the action and why (for example "Timeout the member (missing permission Timeout Members)"), whatever Log to mod log says: at most once an hour per rule and action, so a rule on every message cannot flood the channel. Route Bot Alert entries to a staff channel in Mod Logs to see them. With Log to mod log on, the rule's Automation Rule Fired entry also names each failed action, on every run.
A rule fires too often
- Add conditions, for example User has any of these roles with NOT to leave staff alone, or Channel is to limit it to certain channels.
- Set a Cooldown (seconds) or a Max executions per user under Advanced. Cooldown applies to: Per member stops one member from setting the rule off again without holding it back for everyone else.
- A moderation rule that reacts to punishments can also react to the ones automation rules hand out: turn Automatic actions off under the trigger to leave those alone.
- Rules that change roles or nicknames can set off other rules through Discord's events, and those chains are not cut off: give such rules a cooldown and check that one rule does not keep triggering another. Messages a rule posts never run a rule.
A variable shows up as text
The variable is not available for that trigger or is misspelled. See Variables for the names and when each is filled in.
A scheduled rule runs at the wrong time
Schedules use the server's primary timezone, and a rule saved before the timezone changed keeps the old one until you edit and save it again. The bot checks schedules once a minute.