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

# Antiraid

> Automatically detect potential raids and ongoing raids.

## Configuring the antiraid system

Firstly, toggle on antiraid using the `,antiraid toggle on` command.

## Setting up antiraid modules

<Warning>
  Antiraid is **not** like [antinuke](/moderation/antinuke) and can be edited by **anyone** with the `administrator` permission.
</Warning>

Antiraid consists of several modules that monitor join events to prevent raids.

### Available Modules

<AccordionGroup>
  <Accordion title="Mass Join">
    Detects when a large number of members join your server in a short period.

    * **Usage:**

          <CodeGroup>
            ```javascript Command theme={null}
            ,antiraid massjoin (status) [flags]
            ```

            ```javascript Example theme={null}
            ,antiraid massjoin on --threshold 5 --do ban --lock true --punish true
            ```
          </CodeGroup>
  </Accordion>

  <Accordion title="Avatar">
    Detects members joining with the default Discord profile picture.

    * **Usage:**

          <CodeGroup>
            ```javascript Command theme={null}
            ,antiraid avatar (status) [flags]
            ```

            ```javascript Example theme={null}
            ,antiraid avatar on --do kick
            ```
          </CodeGroup>
  </Accordion>

  <Accordion title="New Accounts">
    Detects members joining with accounts created very recently.

    * **Threshold:** Age in days (e.g., 3 days).
    * **Usage:**

          <CodeGroup>
            ```javascript Command theme={null}
            ,antiraid age (status) [flags]
            ```

            ```javascript Example theme={null}
            ,antiraid age on --threshold 8 --do ban
            ```
          </CodeGroup>
  </Accordion>

  <Accordion title="Mass Mention">
    Detects and prevents mass mention raids from incoming members.

    * **Usage:**

          <CodeGroup>
            ```javascript Command theme={null}
            ,antiraid massmention [status] [flags]
            ```

            ```javascript Example theme={null}
            ,antiraid massmention on (flags)
            ```
          </CodeGroup>

    <Tip>
      This module is part of greed premium.
    </Tip>
  </Accordion>

  <Accordion title="Unverified Bots">
    Prevents unverified bots from joining your server.

    * **Usage:**

          <CodeGroup>
            ```javascript Command theme={null}
            ,antiraid unverifiedbots [status] [flags]
            ```

            ```javascript Example theme={null}
            ,antiraid unverifiedbots on (flags)
            ```
          </CodeGroup>

    <Tip>
      This module is part of greed premium.
    </Tip>
  </Accordion>

  <Accordion title="Username">
    Filters members joining with specific username patterns.

    * **Usage:**

          <CodeGroup>
            ```javascript Command theme={null}
            ,antiraid username
            ```

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

    <Tip>
      This module is part of greed premium.
    </Tip>
  </Accordion>
</AccordionGroup>

### Module Configuration

You can configure each module using the following commands:

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid module [status]
  ```

  ```javascript Example theme={null}
  ,antiraid massjoin on
  ```
</CodeGroup>

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid (module) threshold (value)
  ```

  ```javascript Example theme={null}
  ,antiraid massjoin on --threshold 5
  ```
</CodeGroup>

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid (module) (status) (action)
  ```

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

## Username Patterns

<Tip>
  Username patterns are part of greed premium.
</Tip>

You can manage username patterns to block specific types of accounts from joining.

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid username add (pattern)
  ```

  ```javascript Example theme={null}
  ,antiraid username add raid-bot-.*
  ```
</CodeGroup>

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid username remove (pattern)
  ```

  ```javascript Example theme={null}
  ,antiraid username remove raid-bot-.*
  ```
</CodeGroup>

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid username list
  ```

  ```javascript Example theme={null}
  ,antiraid username list
  ```
</CodeGroup>

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid username action (kick/ban)
  ```

  ```javascript Example theme={null}
  ,antiraid username action ban
  ```
</CodeGroup>

## Mass Mention

Configure thresholds for mass mention detection.

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid (module) [status]
  ```

  ```javascript Example theme={null}
  ,antiraid massmention on flags]
  ```
</CodeGroup>

## Unverified Bots

Set actions for unverified bots trying to join.

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid unverifiedbots [status] [flags]
  ```

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

## state

If your server is under an active raid, you can use the lockdown command to quickly restrict access.

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid state (status)
  ```

  ```javascript Example theme={null}
  ,antiraid state on
  ```
</CodeGroup>

## Whitelisting

You can whitelist specific users or roles from being affected by the antiraid.

<CodeGroup>
  ```javascript Command theme={null}
  ,antiraid whitelist [user]
  ```

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

To **remove** an antiraid whitelisted , you simply use the same `,antiraid whitelist ` command.

<CodeGroup>
  ```javascript command theme={null}
  ,antiraid whitelist [user]
  ```

  ```text example theme={null}
  ,antiraid whitelist @fe3murs
  ```
</CodeGroup>
