Create AutoMod rule
create_automod_ruleConfigure Discord server moderation rules: filter keywords, presets (slurs, profanity, sexual content), spam, or mention limits. Actions include blocking, alerting, or timing out senders.
Instructions
Create a server-side moderation rule that runs on Discord's own infrastructure: Discord-maintained preset word lists (slurs, profanity, sexual content), custom keyword filters (with optional regex), spam detection, or mention-flood limits. For slur or hate-speech filtering prefer trigger keyword_preset with the slurs preset: Discord maintains the word list, so none needs to be written. Actions: block the message, alert a channel, and/or time the sender out (timeout is not available on spam or keyword_preset rules).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guild | No | Guild (server) name or ID. Omit to use the default guild. | |
| name | Yes | ||
| trigger | Yes | ||
| keywords | No | For keyword rules. Wildcards: word* matches prefixes. | |
| regex_patterns | No | For keyword rules; Rust-flavored regex. | |
| presets | No | For keyword_preset rules: Discord-maintained lists. | |
| allow_list | No | Words exempt from keyword and keyword_preset rules. | |
| mention_limit | No | For mention_spam rules: max unique mentions per message. | |
| actions | Yes | What happens on a match. | |
| alert_channel | No | Where alert actions post. | |
| timeout_minutes | No | How long timeout actions last. | |
| exempt_roles | No | ||
| exempt_channels | No | ||
| enabled | No | Default true. |