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

# Antiraid

> A system that protects your server from raids and mass joins.

## Overview

Antiraid watches who's coming through the door. It's built around three independent modules — you can run all of them, or just the ones that fit your server.

<Info>
  Every command here requires the **Manage Server** permission.
</Info>

<Warning>
  A module has to be turned **off** before you can change its settings. If it's already running, confine will tell you to disable it first rather than silently overwriting your configuration.
</Warning>

## Flags

Antiraid uses `$` flags rather than dashes. They go after the on/off toggle, in any order.

| Flag          | Applies to              | Purpose                                            |
| ------------- | ----------------------- | -------------------------------------------------- |
| `$punishment` | All modules             | The punishment handed out when the module triggers |
| `$threshold`  | Mass join, new accounts | The number the module measures against             |
| `$lock`       | Mass join only          | Whether channels lock during a detected raid       |
| `$punish`     | Mass join only          | Whether members joining mid-lockdown get punished  |

<Tip>
  Pass an invalid punishment and confine will list the valid ones back to you — no need to memorize them.
</Tip>

## Mass join detection

Triggers when too many accounts join in a short burst, which is what an actual raid looks like from the server's side.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,antiraid massjoin (on or off) $threshold (number) $punishment (punishment) $lock (true or false) $punish (true or false)
  ```

  ```javascript Example theme={null}
  ,antiraid massjoin on $threshold 10 $punishment kick $lock true $punish true
  ```
</CodeGroup>

<Info>
  The threshold here is measured **per 10 seconds**. A threshold of 10 means ten joins inside that window sets the module off.
</Info>

### Lockdown

When `$lock` is on, hitting the threshold puts the server into a lockdown state and closes your channels. Turning `$punish` on extends that to anyone who slips in while the lockdown is active.

Lockdown doesn't lift on its own. To end it:

```javascript theme={null}
,antiraid mode
```

That unlocks every channel and stops punishing new arrivals. `,antiraid state` does the same thing.

<Info>
  Running `,antiraid mode` outside of an active lockdown just reports that nothing's happening — lockdown only ever starts from a mass join detection.
</Info>

## Avatar requirement

Catches accounts that join with Discord's default avatar, a common giveaway for throwaway alts.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,antiraid avatar (on or off) $punishment (punishment)
  ```

  ```javascript Example theme={null}
  ,antiraid avatar on $punishment kick
  ```
</CodeGroup>

There's no threshold on this one — it's a straight yes-or-no check on each join.

## Account age

Blocks accounts created too recently to be trusted.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,antiraid newaccounts (on or off) $threshold (number) $punishment (punishment)
  ```

  ```javascript Example theme={null}
  ,antiraid newaccounts on $threshold 7 $punishment kick
  ```
</CodeGroup>

<Info>
  The threshold is in **days**. Set it to 7 and any account younger than a week gets punished on join.
</Info>

## Whitelisting members

Whitelisted members skip antiraid checks entirely.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,antiraid whitelist (member)
  ```

  ```javascript Example theme={null}
  ,antiraid whitelist financely
  ```
</CodeGroup>

<Info>
  This command toggles. Running it on someone already whitelisted removes them instead of adding them twice.
</Info>

To see who's on the list, run `,antiraid whitelist view`.

## Checking your configuration

```javascript theme={null}
,antiraid config
```

Shows which modules are live, your mass join threshold and lock/punish settings, your account age threshold, and how many members are whitelisted.
