AutoMod Rule Builder
Build Discord AutoMod rules visually. Configure triggers, actions, and exemptions for automated server moderation.
// 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.
Spam Detection
Automatically detect and block spam messages using Discord's built-in spam detection algorithms.
Keyword Presets
Use Discord's pre-configured word lists for common moderation needs. Choose from profanity, sexual content, and slurs.
Mention Spam
Limit the number of user/role mentions per message to prevent mention spam and raids.
AutoMod Actions
What happens when a rule is triggered
Block Message
Prevent the message from being sent to the channel.
Send Alert Message
Send a notification to a specific channel for moderator review.
Timeout User
Temporarily timeout the user who triggered the rule.
ℹ️ 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
Related Tools
More tools for Discord bot development