> ## 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.

# Antiraid

> Detect join floods, new accounts, selfbots and spam waves — and pause invites before they land.

Where [antinuke](/security/antinuke) watches people who already have permissions, antiraid watches people arriving. Its main lever isn't punishment — it's **pausing invites**, which is the only thing that actually stops a raid rather than cleaning up after one.

Requires **Administrator** to configure.

## Start here

```javascript theme={null}
!antiraid channel #alerts
```

Every detection posts here: what triggered, who was involved, what was done about it. Without an alert channel you'll find out about raids from your members. Aliases: `alertchannel`, `alerts`, `log`, `logs`.

## Detection modules

<AccordionGroup>
  <Accordion title="massjoin — a flood of joins" icon="door-open">
    ```javascript theme={null}
    !antiraid massjoin on 30s --threshold 8 --punishment ban
    ```

    Triggers when more than `threshold` members join inside the given timeframe. Everyone in the burst is punished, and invites are paused for the [configured duration](#pausing-invites).

    | Flag           | Aliases                            | Default     |
    | -------------- | ---------------------------------- | ----------- |
    | `--threshold`  | `count`, `amount`, `t`             | `5` (min 2) |
    | `--punishment` | `action`, `punish`, `do`, `p`, `a` | `ban`       |

    Aliases: `massjoins`, `mass`, `join`, `joins`.

    <Tip>
      Tune the timeframe to your growth rate. A server that gets 3 joins a day should use `30s --threshold 5`. A server that gets 200 a day needs something much looser or you'll ban legitimate traffic every time you get posted somewhere.
    </Tip>
  </Accordion>

  <Accordion title="newaccount — accounts created recently" icon="user-clock">
    ```javascript theme={null}
    !antiraid newaccount on 7d --punishment kick
    ```

    Punishes members whose Discord account is younger than the threshold. `kick` is the usual choice — it keeps the account out for now without permanently blocking someone who genuinely just made an account.

    Aliases: `new`, `accountage`, `account`, `age`.
  </Accordion>

  <Accordion title="avatar — accounts with no profile picture" icon="user">
    ```javascript theme={null}
    !antiraid avatar on --punishment kick
    ```

    Requires a custom avatar to stay in the server. Crude but effective — throwaway raid accounts rarely bother setting one.

    Aliases: `pfp`, `pfpcheck`, `nopfp`, `requirepfp`.

    <Warning>
      This has real false positives. Plenty of normal people never set an avatar. Use `kick` rather than `ban`, and consider leaving it off unless you're actively being raided.
    </Warning>
  </Accordion>

  <Accordion title="automation — selfbots and browser accounts" icon="robot">
    ```javascript theme={null}
    !antiraid automation on --punishment ban
    ```

    Flags accounts that look automated: online via web only, never on mobile or desktop, not a booster, and joined within the last three days. That combination is very close to a signature for scripted accounts.

    Aliases: `antispoof`, `spoof`, `browser`, `selfbot`, `alt`, `web`.
  </Accordion>

  <Accordion title="spam — one member flooding messages" icon="comment">
    ```javascript theme={null}
    !antiraid spam on 5s --threshold 8 --punishment timeout --for 10m
    ```

    Punishes a **single** member sending too many messages too quickly. Their messages are cleaned up as well.

    | Flag           | Aliases                 | Default         |
    | -------------- | ----------------------- | --------------- |
    | `--threshold`  | `count`, `t`            | `8` (min 3)     |
    | `--punishment` | `action`, `p`           | `timeout`       |
    | `--for`        | `time`, `duration`, `l` | `10m` (max 28d) |

    Aliases: `msgspam`, `messagespam`.
  </Accordion>

  <Accordion title="raidspam — a channel being flooded by many accounts" icon="comments">
    ```javascript theme={null}
    !antiraid raidspam on 10s --threshold 4 --messages 15 --punishment ban
    ```

    The coordinated version of `spam`. Triggers when several **different** accounts flood one channel together — the channel is locked and everyone involved is punished.

    | Flag           | Aliases                           | Default      |
    | -------------- | --------------------------------- | ------------ |
    | `--threshold`  | `users`, `members`, `unique`, `u` | `4` (min 2)  |
    | `--messages`   | `count`, `msgs`, `m`              | `15` (min 3) |
    | `--punishment` | `action`, `p`                     | `ban`        |

    Aliases: `flood`, `massspam`, `floodspam`, `channelspam`.
  </Accordion>

  <Accordion title="mentionspam — too many pings in one message" icon="at">
    ```javascript theme={null}
    !antiraid mentionspam on --threshold 6 --punishment timeout
    ```

    Counts mentions in a **single** message. Default threshold is `5`, minimum `3`.

    Aliases: `mention`, `mentions`, `pingspam`, `pings`.

    <Note>
      [Automod mentions](/security/automod#mention-limits) does something similar but through Discord's native AutoMod, which blocks the message before it ever appears. Antiraid's version punishes after the fact. Running both is reasonable — automod stops the ping, antiraid handles the account.
    </Note>
  </Accordion>
</AccordionGroup>

### Punishments

Every module takes `--punishment` with one of:

| Value     | Effect                                     |
| --------- | ------------------------------------------ |
| `ban`     | Banned from the server                     |
| `kick`    | Removed, can rejoin                        |
| `timeout` | Timed out for `--for` (max 28 days)        |
| `jail`    | Given the jail role — needs `!setup` first |

## Pausing invites

When a module triggers, invites are paused automatically. Discord also blocks DMs from server members for the same window, which shuts down the DM-scam half of most raids.

<CodeGroup>
  ```javascript How long the auto-pause lasts theme={null}
  !antiraid duration 30m
  ```

  ```javascript Pause manually, right now theme={null}
  !antiraid pause 30m
  ```

  ```javascript Lift it early theme={null}
  !antiraid resolve
  ```
</CodeGroup>

`duration` aliases: `pausefor`, `lockfor`, `freezefor`. `pause` aliases: `lock`, `freeze`. `resolve` aliases: `status`, `state`, `resume`, `unpause`, `unlock`, `unfreeze`.

`!antiraid resolve` is the "it's over" command — it lifts the invite pause and unlocks any channels `raidspam` locked. Run it once you've cleaned up.

<Info>
  Discord caps invite pauses at **24 hours**. Anything longer is clamped.
</Info>

## Temporarily disabling

Doing a partnered event, a bot list bump, or anything else that'll cause a legitimate join spike:

```javascript theme={null}
!antiraid disable 2h
```

Turns antiraid off for the duration, then re-enables it automatically. Much safer than turning modules off by hand and forgetting to turn them back on. Aliases: `temp`, `stop`, `cancel`.

## Whitelisting

```javascript theme={null}
!antiraid whitelist @someone
!antiraid whitelist list
```

Exempt users are never punished by any antiraid module. Aliases: `exempt`, `wl`.

## Reviewing the configuration

```javascript theme={null}
!antiraid settings
```

Shows every module, its state, timeframe, threshold, punishment, the alert channel, the pause duration and the whitelist.

## Command reference

| Command                                            | Description                     |
| -------------------------------------------------- | ------------------------------- |
| `antiraid channel <channel>`                       | Set the alert channel           |
| `antiraid massjoin (on/off) [timeframe] [flags]`   | Join-flood detection            |
| `antiraid newaccount (on/off) [threshold] [flags]` | Minimum account age             |
| `antiraid avatar (on/off) [flags]`                 | Require a profile picture       |
| `antiraid automation (on/off) [flags]`             | Selfbot detection               |
| `antiraid spam (on/off) [timeframe] [flags]`       | Single-member message spam      |
| `antiraid raidspam (on/off) [timeframe] [flags]`   | Multi-account channel flooding  |
| `antiraid mentionspam (on/off) [flags]`            | Mentions per message            |
| `antiraid duration [duration]`                     | Auto-pause length               |
| `antiraid pause [duration]`                        | Pause invites now               |
| `antiraid resolve`                                 | Lift the current raid state     |
| `antiraid disable [duration]`                      | Temporarily switch antiraid off |
| `antiraid whitelist <user>`                        | Toggle an exemption             |
| `antiraid whitelist list`                          | View exemptions                 |
| `antiraid settings`                                | Full configuration overview     |

Every command requires **Administrator**. Group aliases: `raid`, `warden`, `wd`.
