discord_create_automod_rule
Creates Discord AutoMod rules to filter keywords, spam, mention raids, or suspicious profiles and apply block, alert, timeout, or interaction-block actions.
Instructions
Create an AutoMod rule. Requires Manage Server (Discord gates AutoMod on it) and the server to have the AutoModeration feature, which arrives with Community. Trigger types: 'keyword' (keyword_filter + optional regex_patterns), 'keyword_preset' (Discord's built-in profanity/sexual_content/slurs lists), 'spam', 'mention_spam' (mention_total_limit), 'member_profile' (blocks suspicious profile text). Actions: block_message, send_alert_message (needs channel_id), timeout (needs duration_seconds), block_member_interaction. Returns the created rule.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name shown in Server Settings. | |
| reason | No | Optional reason recorded in the audit log. | |
| actions | Yes | Actions to take on a match. | |
| enabled | No | Whether the rule is active on creation. | |
| presets | No | Discord's built-in keyword lists (keyword_preset trigger). | |
| guild_id | Yes | Discord server (guild) ID (snowflake). | |
| keywords | No | Keywords to match (keyword trigger). Max 1000, each up to 60 characters. | |
| allow_list | No | Words that are exempt from the keyword filter. Max 100. | |
| event_type | No | Which gateway event the rule watches. | message_send |
| trigger_type | Yes | What triggers the rule. | |
| regex_patterns | No | Regular expressions to match (keyword trigger). Max 10. | |
| exempt_role_ids | No | Roles exempt from the rule. | |
| exempt_channel_ids | No | Channels exempt from the rule. | |
| mention_total_limit | No | Unique mentions allowed per message before the rule fires (mention_spam trigger). | |
| mention_raid_protection | No | Also block messages that mention a role or exceed the limit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| name | Yes | ||
| actions | Yes | ||
| enabled | Yes | ||
| presets | Yes | ||
| keywords | Yes | ||
| allow_list | Yes | ||
| creator_id | Yes | ||
| event_type | Yes | ||
| trigger_type | Yes | ||
| regex_patterns | Yes | ||
| exempt_role_ids | Yes | ||
| exempt_channel_ids | Yes | ||
| mention_total_limit | Yes | ||
| mention_raid_protection | Yes |