---
title: "Mastering Discord AutoMod"
description: "Advanced native rule configuration, keyword filters, regular expressions, and automated spam mitigation."
---

import { Tabs, TabItem } from '@astrojs/starlight/components';
import DiscordMessage from '../../../components/DiscordMessage.astro';

**Discord AutoMod** is one of the most powerful and underutilized defense systems built directly into server settings. Unlike external bots, it executes with zero network latency at the Discord API level before an offending message can ever render in public channels.

---

## The 4 Core Native Rules

<Tabs>
  <TabItem label="1. Mention Spam Shield">
    - **Recommended Threshold**: 3 to 5 mentions per message.
    - **Recommended Action**: Block message + Log alert to `#automod-alerts` + Timeout user for 1 hour.
    - **Purpose**: Instantly halts mass-mention bots that ping random members.
  </TabItem>
  <TabItem label="2. Suspected Spam Detection">
    - Employs Discord's internal machine learning heuristics to catch repetitive bursts or copypasta spam.
    - **Recommended Action**: Block message and log alert to audit channels.
  </TabItem>
  <TabItem label="3. Blocked Words & Keywords">
    - High-severity insults, hate speech, racial or homophobic slurs.
    - **Wildcard Syntax**: Use `*keyword*` to trap compound words and prefix/suffix variations.
  </TabItem>
  <TabItem label="4. Custom Regular Expressions (Regex)">
    - Customized matching for unauthorized invite URLs, phone formats, or suspicious token patterns.
  </TabItem>
</Tabs>

---

## Essential Regex Patterns for Moderation

Configure these regular expressions inside custom AutoMod rules:

### Block Unauthorized Discord Invites
```regex
(discord\.(gg|io|me|li)|discordapp\.com\/invite)\/[a-zA-Z0-9]+
```
> Intercepts external server invite links across public channels, except in whitelisted channels (e.g. `#partnerships`).

### Block Common Nitro Phishing Domains
```regex
(discorcl|dlscord|disord|free-nitro|discord-gift|nitro-drop)\.[a-z]{2,}
```

---

## Example AutoMod Alert Notification

When an account triggers an AutoMod rule, your `#automod-alerts` channel receives an instant breakdown:

<DiscordMessage 
  author="Discord AutoMod" 
  bot={true} 
  roleColor="#5865F2" 
  timestamp="Today at 4:45 PM" 
  content="🛡️ **Message Blocked**: A message violating server policy was prevented from posting."
  embed={{
    color: "#FEE75C",
    title: "Rule Violated: Phishing Link Filter",
    fields: [
      { name: "Author", value: "Player_Unknown (ID: 412891823)", inline: true },
      { name: "Channel", value: "#general-chat", inline: true },
      { name: "Blocked Content", value: "Get free Discord Nitro here: http://discorcl-gift.ru/claim!", inline: false },
      { name: "Action Taken", value: "Message blocked + 1 hour preventative timeout", inline: false }
    ],
    footer: "Discord Native AutoMod • Community Defense Engine"
  }}
/>
