🛡️

AutoMod Rule Builder

Build Discord AutoMod rules visually. Configure triggers, actions, and exemptions for automated server moderation.

Block Message
// Discord.js AutoMod Rule Configuration
// Create this rule in your guild

const rule = await guild.autoModerationRules.create({
  name: 'My AutoMod Rule',
  enabled: true,
  eventType: GuildAutoModEventType.MessageSend,
  triggerType: GuildAutoModTriggerType.Keyword,
  triggerMetadata: {
    
  },
  actions: [
    {
      type: GuildAutoModActionType.BlockMessage,
    },
  ],
});

console.log('AutoMod rule created:', rule.name);

💡Quick Tips

  • AutoMod rules require the MANAGE_GUILD permission
  • You can have up to 6 AutoMod rules per guild
  • Keyword filters support wildcards with * (e.g., "bad*word")
  • Use allow lists to prevent false positives for legitimate words
  • Multiple actions can be triggered for a single rule violation
  • Exempt roles and channels bypass all AutoMod rules for that specific rule

AutoMod Trigger Types

Understanding Discord's AutoMod trigger options

🔤

Keyword Filter

Block messages containing specific words or phrases. Supports wildcards and regex patterns for advanced filtering.

Add custom keywords to block
Use regex for complex patterns
Create allow lists for exceptions
Wildcards: "bad*word" matches "badword", "bad word", etc.
🚫

Spam Detection

Automatically detect and block spam messages using Discord's built-in spam detection algorithms.

No configuration required
Detects repetitive messages
Identifies common spam patterns
Works out of the box
📚

Keyword Presets

Use Discord's pre-configured word lists for common moderation needs. Choose from profanity, sexual content, and slurs.

Profanity: Common vulgar language
Sexual Content: Explicit terms
Slurs: Hate speech and discrimination
Maintained by Discord, always up-to-date
@️

Mention Spam

Limit the number of user/role mentions per message to prevent mention spam and raids.

Set maximum mention limit (1-50)
Enable raid protection mode
Counts unique user and role mentions
Automatically timeout spammers

AutoMod Actions

What happens when a rule is triggered

🚫

Block Message

Prevent the message from being sent to the channel.

Message is deleted immediately
Optional custom error message
User sees why it was blocked
📢

Send Alert Message

Send a notification to a specific channel for moderator review.

Configure alert channel
Includes user and message info
Useful for manual review

Timeout User

Temporarily timeout the user who triggered the rule.

Set duration (1 sec - 28 days)
Prevents sending messages
Strong deterrent for violations

ℹ️ Multiple Actions

You can combine multiple actions for a single rule! For example, you can both block the message AND send an alert to notify moderators. This allows for comprehensive automated moderation.

AutoMod Best Practices

Tips for effective automated moderation

1. Start with Presets

Begin with Discord's keyword presets (profanity, sexual content, slurs) as they're maintained by Discord and cover most common cases.

2. Use Allow Lists

Prevent false positives by adding legitimate words to allow lists. For example, "assassin" might trigger a filter but is a valid game term.

3. Exempt Moderators

Add moderator and admin roles to exemptions so they can discuss moderation issues without triggering rules.

4. Test Before Enabling

Create rules as disabled first, then test in a private channel before enabling them server-wide.

5. Monitor Alert Channels

Set up alert channels for all rules to review what's being caught and adjust your rules accordingly.

6. Combine Trigger Types

Use multiple rules with different trigger types for comprehensive coverage. For example, one rule for keywords and another for mention spam.

7. Use Wildcards Wisely

Wildcards (*) are powerful but can cause false positives. Test thoroughly when using patterns like "bad*word".

8. Review Regularly

Periodically review your AutoMod rules and adjust based on community needs and false positive reports.

⚠️ AutoMod Limitations

Maximum 6 rules per server: Discord limits each guild to 6 active AutoMod rules
Requires MANAGE_GUILD permission: Only users with this permission can create/edit AutoMod rules
Only MESSAGE_SEND events: Currently AutoMod only works on messages being sent, not edits or other events
Administrators bypass rules: Users with Administrator permission bypass all AutoMod rules by default
Max 1000 keywords: Each keyword filter can contain up to 1000 keywords/patterns
Max 100 allow list words: Each rule can have up to 100 words in its allow list