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

# Antiraid

> Protect your server from mass joins, default PFP accounts, and new accounts with raze's antiraid system.

# Antiraid

> Protect your server from mass joins, default PFP accounts, and new accounts with raze's antiraid system.

## What is antiraid?

The antiraid system monitors members joining your server in real time. When conditions are met — too many joins at once, members with no avatar, or accounts that are too new — raze automatically takes action.

<Warning>
  Run `;antiraid setup` before enabling any antiraid modules.
</Warning>

## Initial setup

```bash theme={null} theme={null}
;antiraid setup
```

## Enable / disable

<CodeGroup>
  ```bash Enable theme={null} theme={null}
  ;antiraid setup
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid disable
  ```
</CodeGroup>

## View configuration

```bash theme={null} theme={null}
;antiraid config
```

Shows the current raid state (Active / Safe) and which modules are enabled.

***

## Modules

### Mass Join

Detects when too many members join within a short window (5 seconds). Useful for bot raids.

<CodeGroup>
  ```bash Enable theme={null} theme={null}
  ;antiraid massjoin on --threshold 5 --do kick --lock false --punish true
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid massjoin off
  ```
</CodeGroup>

| Flag          | Default | Description                                                    |
| ------------- | ------- | -------------------------------------------------------------- |
| `--threshold` | `5`     | Number of joins in 5 seconds to trigger                        |
| `--do`        | `kick`  | Action: `ban`, `kick`, or `mute`                               |
| `--lock`      | `false` | Lock server (removes send\_messages from @everyone) on trigger |
| `--punish`    | `true`  | Whether to punish the triggering member                        |

***

### No Avatar

Punishes members who join with the default Discord profile picture.

<CodeGroup>
  ```bash Enable theme={null} theme={null}
  ;antiraid noavatar on --do kick --punish true
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid noavatar off
  ```
</CodeGroup>

| Flag       | Default | Description                      |
| ---------- | ------- | -------------------------------- |
| `--do`     | `kick`  | Action: `ban`, `kick`, or `mute` |
| `--punish` | `true`  | Whether to punish the member     |

***

### Account Age

Punishes members whose account is younger than the configured threshold.

<CodeGroup>
  ```bash Enable theme={null} theme={null}
  ;antiraid age on --threshold 7 --do kick --punish true
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid age off
  ```
</CodeGroup>

| Flag          | Default | Description                      |
| ------------- | ------- | -------------------------------- |
| `--threshold` | `5`     | Minimum account age in days      |
| `--do`        | `kick`  | Action: `ban`, `kick`, or `mute` |
| `--punish`    | `true`  | Whether to punish the member     |

***

### Advertising Name

Flags members whose username or display name contains a Discord invite link.

<CodeGroup>
  ```bash Enable theme={null} theme={null}
  ;antiraid advertname on --do kick
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid advertname off
  ```
</CodeGroup>

| Flag   | Default | Description                      |
| ------ | ------- | -------------------------------- |
| `--do` | `kick`  | Action: `ban`, `kick`, or `mute` |

***

### Username Filter

Blocks members whose username matches your custom patterns on join.

<CodeGroup>
  ```bash Add a pattern theme={null} theme={null}
  ;antiraid usernamefilter on --add nitro:contains
  ```

  ```bash Remove a pattern theme={null} theme={null}
  ;antiraid usernamefilter on --remove nitro
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid usernamefilter off
  ```
</CodeGroup>

| Flag       | Description                                                                           |
| ---------- | ------------------------------------------------------------------------------------- |
| `--add`    | Add a pattern as `pattern:type` — `type` is the match mode and defaults to `contains` |
| `--remove` | Remove a previously added pattern                                                     |
| `--do`     | Action: `ban`, `kick`, or `mute`                                                      |

***

### Unverified Bot

Rejects unverified bots when they are added to the server.

<CodeGroup>
  ```bash Enable theme={null} theme={null}
  ;antiraid unverifiedbot on --do kick
  ```

  ```bash Disable theme={null} theme={null}
  ;antiraid unverifiedbot off
  ```
</CodeGroup>

| Flag   | Default | Description                      |
| ------ | ------- | -------------------------------- |
| `--do` | `kick`  | Action: `ban`, `kick`, or `mute` |

***

## Actions

| Action | Effect                             |
| ------ | ---------------------------------- |
| `kick` | Removes the member from the server |
| `ban`  | Permanently bans the member        |
| `mute` | Times the member out for 1 hour    |
