> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mira.party/llms.txt
> Use this file to discover all available pages before exploring further.

# Automod

> Word, link, invite and mention filters, managed through Discord's native AutoMod.

Automod is a friendlier front end for Discord's built-in AutoMod rules. Everything you configure here becomes a real rule in your server's settings — which means **Discord** blocks the message, not the bot.

That distinction matters:

* Blocking happens **before** the message is posted. Nobody sees it, not even for a second.
* It works even if mira is offline, rate-limited or missing permissions.
* The rules are visible and editable in Server Settings → AutoMod, so nothing is hidden from you.

Requires **Manage Server**.

## Word filter

<CodeGroup>
  ```javascript Add a word theme={null}
  !automod add slur
  ```

  ```javascript Add a pattern theme={null}
  !automod add discord\.gg/\w+
  ```

  ```javascript Remove one theme={null}
  !automod remove slur
  ```

  ```javascript Wipe everything theme={null}
  !automod clear
  ```
</CodeGroup>

`automod add` accepts plain words and regular expressions — aliases `create`, `regex`. Matching is case-insensitive and catches common letter substitutions, so blocking `nitro` also catches `n1tr0`.

### Allowing exceptions

```javascript theme={null}
!automod ignore scunthorpe
!automod ignore view
```

Substrings on the ignore list bypass the filter, which is how you stop a blocked word from catching an innocent one containing it. Aliases: `allow`, `exclude`.

## Invite filter

```javascript theme={null}
!automod invites on
```

Blocks messages containing Discord invite links. Aliases: `discord`, `inv`.

<CodeGroup>
  ```javascript Allow specific invites theme={null}
  !automod invites ignore discord.gg/mira
  ```

  ```javascript Exempt a role or channel theme={null}
  !automod invites whitelist @Partner
  !automod invites whitelist #partners
  ```

  ```javascript See what's exempt theme={null}
  !automod invites whitelist view
  !automod invites ignore view
  ```
</CodeGroup>

Two different exemptions, worth keeping straight: `ignore` allows a specific **invite string** everywhere, `whitelist` allows a **role or channel** to post any invite.

## Link filter

```javascript theme={null}
!automod links on
```

Blocks all URLs. Aliases: `websites`, `link`, `url`. It has the same `ignore` / `whitelist` split as invites:

```javascript theme={null}
!automod links ignore youtube.com
!automod links whitelist #media
!automod links whitelist @Trusted
```

<Tip>
  Blocking every link outright is heavy-handed for most servers. A better shape is usually: links allowed generally, `#general` whitelisted, and the [honeypot](/security/honeypot) catching the scam links that matter.
</Tip>

## Mention limits

```javascript theme={null}
!automod mentions on 6
```

Blocks messages containing more than the given number of mentions. Aliases: `mention`, `pings`, `ping`.

```javascript theme={null}
!automod mentions raid on
```

Turns on Discord's own mention-raid protection, which handles the coordinated version.

Same whitelist commands: `!automod mentions whitelist @Staff`.

## Suspected spam

```javascript theme={null}
!automod spam on
```

Enables Discord's machine-learning spam classifier. It catches the generic patterns — advertising, repeated content, scam phrasing — without you having to write rules for them. Aliases: `suspected`, `sus`.

## Music file filter

The odd one out: this one is enforced by mira rather than Discord, because Discord can't inspect attachments.

```javascript theme={null}
!automod music on
```

Blocks messages containing music files (MP3, WAV, FLAC and similar) or links to them. Built for servers that want listening confined to one channel. Aliases: `musicfiles`, `mp3`, `audio`, `files`.

<CodeGroup>
  ```javascript Exempt a role or channel theme={null}
  !automod music exempt #music
  !automod music exempt @DJ
  ```

  ```javascript View exemptions theme={null}
  !automod music exemptions
  ```

  ```javascript Turn it off and clear settings theme={null}
  !automod music reset
  ```
</CodeGroup>

## The whitelist, generally

Most rules share a whitelist shape. The bare form applies to the default word filter:

```javascript theme={null}
!automod whitelist @Moderator
!automod whitelist #staff-chat
!automod whitelist view
```

Pass a rule name first to target a specific rule:

```javascript theme={null}
!automod whitelist links @Trusted
!automod whitelist view invites
```

Whitelisted roles and channels bypass the rule entirely. Aliases: `exempt`, `wl`.

## Command reference

| Command                             | Description                        |
| ----------------------------------- | ---------------------------------- |
| `automod add <word>`                | Add a word or regex to the filter  |
| `automod remove <word>`             | Remove one                         |
| `automod clear`                     | Remove all word and regex filters  |
| `automod ignore <substring>`        | Toggle a bypass substring          |
| `automod ignore view`               | View bypass substrings             |
| `automod invites (on/off)`          | Discord invite filter              |
| `automod links (on/off)`            | URL filter                         |
| `automod mentions (on/off) [limit]` | Mention count limit                |
| `automod mentions raid (on/off)`    | Mention-raid protection            |
| `automod spam (on/off)`             | Suspected spam classifier          |
| `automod music (on/off)`            | Music file filter                  |
| `automod music exempt <target>`     | Toggle a music filter exemption    |
| `automod music reset`               | Disable and clear the music filter |
| `automod whitelist [rule] [target]` | Toggle a role/channel exemption    |
| `automod whitelist view [rule]`     | View exemptions                    |

Every command requires **Manage Server**. Group alias: `filter`.

<Note>
  Discord limits how many AutoMod rules a server can have. If a command fails with a rule-limit error, remove an unused rule in Server Settings → AutoMod and try again.
</Note>
