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

# Protect Your Discord Server from Raids with Anti-Raid

> Stop coordinated raids before they cause damage by blocking mass join waves, freshly-created alt accounts, and users with default Discord avatars.

Anti-Raid gives you three independent protection modules that each target a different vector attackers use to flood or disrupt your server. You can enable any combination of modules, each with its own punishment and threshold, and maintain a whitelist of trusted users who are never affected. Unlike Anti-Nuke, Anti-Raid modules are configured and toggled through individual sub-commands — there is no global enable/disable switch.

<Note>
  All Anti-Raid commands require the **Manage Server** permission. The whitelist is global across all modules by default; a separate per-module whitelist is available for **New Accounts**.
</Note>

***

## Protection Modules

<CardGroup cols={3}>
  <Card title="Mass Join" icon="users">
    Monitors the join rate in a rolling 10-second window. When the number of joins exceeds your threshold, every member in that wave is punished.
  </Card>

  <Card title="New Accounts" icon="calendar-xmark">
    Checks account age on every join. Accounts younger than your threshold (in days) are automatically kicked or banned before they can interact with your server.
  </Card>

  <Card title="Default Avatar" icon="image-slash">
    Rejects any user who joins with the default Discord avatar — a strong indicator of a throwaway or bot account.
  </Card>
</CardGroup>

***

## Mass Join

The Mass Join module tracks how many users join within a 10-second sliding window. Once the number of joins in that window exceeds the threshold you set, XRYPTON punishes every account that joined in the wave.

### Enable Mass Join

```discord theme={null}
/antiraid massjoin enable --do <punishment> --threshold <joins>
```

| Flag          | Description                                                            |
| ------------- | ---------------------------------------------------------------------- |
| `--do`        | Punishment to apply: `kick` or `ban`.                                  |
| `--threshold` | Maximum number of joins allowed in 10 seconds before the module fires. |

**Example** — ban if more than 5 users join within 10 seconds:

```discord theme={null}
/antiraid massjoin enable --do ban --threshold 5
```

### Disable Mass Join

```discord theme={null}
/antiraid massjoin disable
```

<Tip>
  Start with a conservative threshold (e.g. `10`) to avoid false positives when you share an invite publicly. Lower it only when you're actively under a raid.
</Tip>

***

## New Accounts

The New Accounts module checks every incoming member's account creation date. If the account is younger than the age you specify (in days), the member is immediately kicked or banned.

### Enable New Accounts

```discord theme={null}
/antiraid newaccounts on --do <punishment> --threshold <days>
```

| Flag          | Description                                                               |
| ------------- | ------------------------------------------------------------------------- |
| `--do`        | Punishment to apply: `kick` or `ban`.                                     |
| `--threshold` | Minimum account age in **days**. Accounts younger than this are rejected. |

**Example** — kick accounts younger than 30 days:

```discord theme={null}
/antiraid newaccounts on --do kick --threshold 30
```

### Disable New Accounts

```discord theme={null}
/antiraid newaccounts disable
```

### Whitelist a Specific User for New Accounts

If a known person has a new account and you want to let them join, whitelist them specifically for this module. Running the command on an already-whitelisted user removes them (toggle behaviour).

```discord theme={null}
/antiraid newaccounts whitelist @Username
```

<Note>
  The New Accounts whitelist is separate from the global Anti-Raid whitelist. A user whitelisted globally is also exempt from this module, but the module-specific whitelist only bypasses New Accounts checks.
</Note>

***

## Default Avatar

The Default Avatar module fires the moment any user with no custom profile picture joins your server. No threshold is required — the action is taken immediately on every matching join.

### Enable Default Avatar

```discord theme={null}
/antiraid defaultavatar enable --do <punishment>
```

| Flag   | Description                           |
| ------ | ------------------------------------- |
| `--do` | Punishment to apply: `kick` or `ban`. |

**Example** — kick every user who joins with a default avatar:

```discord theme={null}
/antiraid defaultavatar enable --do kick
```

### Disable Default Avatar

```discord theme={null}
/antiraid defaultavatar disable
```

<Warning>
  Some legitimate users never set a profile picture. Consider pairing this module with a lenient punishment (`kick`) rather than `ban`, and make use of the global whitelist for known members who prefer the default avatar.
</Warning>

***

## Managing the Whitelist

The global Anti-Raid whitelist exempts users from all three modules. Use it for moderators, trusted members, or bot accounts that might otherwise trigger mass join detection.

### Add a user to the whitelist

```discord theme={null}
/antiraid whitelist @Username
```

### Remove a user from the whitelist

```discord theme={null}
/antiraid unwhitelist @Username
```

### View the whitelist

```discord theme={null}
/antiraid whitelist view
```

***

## Example Setup

<Steps>
  <Step title="Enable Mass Join protection">
    Block coordinated join waves by banning any account that joins when more than 8 users arrive in a 10-second window.

    ```discord theme={null}
    /antiraid massjoin enable --do ban --threshold 8
    ```
  </Step>

  <Step title="Enable New Accounts protection">
    Reject accounts younger than 14 days to filter out freshly-created alts and bot accounts.

    ```discord theme={null}
    /antiraid newaccounts on --do kick --threshold 14
    ```
  </Step>

  <Step title="Enable Default Avatar protection">
    Kick anyone who joins without a custom profile picture.

    ```discord theme={null}
    /antiraid defaultavatar enable --do kick
    ```
  </Step>

  <Step title="Whitelist your trusted moderators">
    Make sure your staff are never caught by the modules you just enabled.

    ```discord theme={null}
    /antiraid whitelist @ModeratorOne
    /antiraid whitelist @ModeratorTwo
    ```
  </Step>

  <Step title="Whitelist a specific new account (if needed)">
    If a trusted member happens to have a brand-new account and can't pass the age check, whitelist them for that module specifically.

    ```discord theme={null}
    /antiraid newaccounts whitelist @NewMember
    ```
  </Step>

  <Step title="Review your configuration">
    Confirm all three modules are active and their punishments/thresholds look correct.

    ```discord theme={null}
    /antiraid settings
    ```
  </Step>
</Steps>

***

## Viewing Settings

Run the settings command at any time to see which modules are active, what punishment each uses, and what threshold is set.

```discord theme={null}
/antiraid settings
```

XRYPTON responds with an embed showing the current raid state (**Safe** if all modules are on, **Unsafe** if any are off) along with per-module details.

***

## Command Reference

| Command                          | Aliases           | Syntax                                                            | Description                                                                        |
| -------------------------------- | ----------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `antiraid massjoin enable`       | `on`              | `/antiraid massjoin enable --do <punishment> --threshold <joins>` | Enables Mass Join protection with the given punishment and join threshold.         |
| `antiraid massjoin disable`      | `off`             | `/antiraid massjoin disable`                                      | Disables Mass Join protection.                                                     |
| `antiraid newaccounts on`        | `enable`          | `/antiraid newaccounts on --do <punishment> --threshold <days>`   | Enables New Accounts protection with the given punishment and minimum age in days. |
| `antiraid newaccounts disable`   | `off`             | `/antiraid newaccounts disable`                                   | Disables New Accounts protection.                                                  |
| `antiraid newaccounts whitelist` | `wl`              | `/antiraid newaccounts whitelist <user>`                          | Adds or removes a user from the New Accounts-specific whitelist (toggles).         |
| `antiraid defaultavatar enable`  | `on`              | `/antiraid defaultavatar enable --do <punishment>`                | Enables Default Avatar protection with the given punishment.                       |
| `antiraid defaultavatar disable` | `off`             | `/antiraid defaultavatar disable`                                 | Disables Default Avatar protection.                                                |
| `antiraid whitelist`             | `wl`              | `/antiraid whitelist <user>`                                      | Adds a user to the global Anti-Raid whitelist.                                     |
| `antiraid unwhitelist`           | `unwl`            | `/antiraid unwhitelist <user>`                                    | Removes a user from the global Anti-Raid whitelist.                                |
| `antiraid whitelist view`        | —                 | `/antiraid whitelist view`                                        | Displays all globally whitelisted users.                                           |
| `antiraid settings`              | `stats`, `config` | `/antiraid settings`                                              | Shows the current status, punishment, and threshold for each module.               |

<Accordion title="Accepted punishment values">
  Both `--do` flags across all modules accept:

  * `kick` — removes the user from the server (they can rejoin)
  * `ban` — permanently bans the user from the server
</Accordion>
