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

# Join gate

> Prevent automated accounts from joining your server.

## Configuring the antiraid system

### Preventing mass joins

This module will trigger when the number of accounts joining the server exceeds the threshold within a short time frame.

<Warning>
  Whenever the threshold is reached, the server will be placed in a raid state. This will temporarily disable intensive events which bleed dispatches, such as **welcome** and **goodbye** messages.
</Warning>

<CodeGroup>
  ```typescript Syntax theme={null}
  .antiraid massjoin (on or off) [--threshold (number)] [--do (action)] [--lock (true | false)] [--punish (true | false)]
  ```

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

<AccordionGroup>
  <Accordion title="Threshold">
    The threshold is the number of accounts that can join the server within the time frame.

    <Info>
      It's recommended to keep the threshold between `5` and `10` to stay safe.
    </Info>

    <CodeGroup>
      ```typescript Syntax theme={null}
      --threshold (number)
      ```

      ```typescript Example theme={null}
      --threshold 5
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Punishment">
    The action which will be taken when the threshold is reached.

    <Info>
      Available actions are `ban` and `kick`.
    </Info>

    <CodeGroup>
      ```typescript Syntax theme={null}
      --do (action)
      ```

      ```typescript Example theme={null}
      --do ban
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Lock channels">
    Whether to lock all channels when the threshold is reached.

    <CodeGroup>
      ```typescript Syntax theme={null}
      --lock (true | false)
      ```

      ```typescript Example theme={null}
      --lock true
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Punish new accounts">
    Whether to punish new accounts that join the server.

    <CodeGroup>
      ```typescript Syntax theme={null}
      --punish (true | false)
      ```

      ```typescript Example theme={null}
      --punish true
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<Frame>
  <img src="https://mintcdn.com/drown/RhXQUEdLw0fdP_5Y/images/Screenshot-2026-04-13-at-11.50.24-PM.png?fit=max&auto=format&n=RhXQUEdLw0fdP_5Y&q=85&s=a063946e50e27bee8f2a390036a2dc5e" alt="Screenshot 2026 04 13 At 11 50 24 PM" width="1336" height="406" data-path="images/Screenshot-2026-04-13-at-11.50.24-PM.png" />
</Frame>

### Requiring an avatar

This module will trigger when an account joins the server without an avatar.

<CodeGroup>
  ```typescript Syntax theme={null}
  .antiraid avatar (on or off) [--do (action)]
  ```

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

<AccordionGroup>
  <Accordion title="Punishment">
    The action which will be taken when the threshold is reached.

    <Info>
      Available actions are `ban` and `kick`.
    </Info>

    <CodeGroup>
      ```typescript Syntax theme={null}
      --do (action)
      ```

      ```typescript Example theme={null}
      --do ban
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<Frame>
  <img src="https://mintcdn.com/drown/RhXQUEdLw0fdP_5Y/images/Screenshot-2026-04-13-at-11.51.07-PM.png?fit=max&auto=format&n=RhXQUEdLw0fdP_5Y&q=85&s=91f891bb26086e1ebdeac7e79e5336f5" alt="Screenshot 2026 04 13 At 11 51 07 PM" width="1214" height="372" data-path="images/Screenshot-2026-04-13-at-11.51.07-PM.png" />
</Frame>

### Setting a minimum account age

This module will trigger when an account joins the server that is younger than the specified age.

<Info>
  The `threshold` flag is the numbers of days for an account to be considered old enough.
</Info>

<CodeGroup>
  ```typescript Syntax theme={null}
  .antiraid age (on or off) [--threshold (number)] [--do (action)]
  ```

  ```typescript Example theme={null}
  .antiraid age on --threshold 7 --do ban
  ```
</CodeGroup>

<AccordionGroup>
  <Accordion title="Threshold">
    The threshold is the number of accounts that can join the server within the time frame.

    <Info>
      It's recommended to keep the threshold between `5` and `10` to stay safe.
    </Info>

    <CodeGroup>
      ```typescript Syntax theme={null}
      --threshold (number)
      ```

      ```typescript Example theme={null}
      --threshold 5
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Punishment">
    The action which will be taken when the threshold is reached.

    <Info>
      Available actions are `ban` and `kick`.
    </Info>

    <CodeGroup>
      ```typescript Syntax theme={null}
      --do (action)
      ```

      ```typescript Example theme={null}
      --do ban
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<Frame>
  <img src="https://mintcdn.com/drown/RhXQUEdLw0fdP_5Y/images/Screenshot-2026-04-13-at-11.54.55-PM.png?fit=max&auto=format&n=RhXQUEdLw0fdP_5Y&q=85&s=0666aea58547f88a0698adab59b5b58c" alt="Screenshot 2026 04 13 At 11 54 55 PM" width="1332" height="394" data-path="images/Screenshot-2026-04-13-at-11.54.55-PM.png" />
</Frame>

### Exempting accounts from the antiraid

You can exempt accounts from the antiraid with the `antiraid whitelist` command.

<Info>
  You can use the `antiraid whitelist view` command to view all whitelisted accounts.
</Info>

<CodeGroup>
  ```typescript Syntax theme={null}
  .antiraid whitelist (user) (duration)
  ```

  ```typescript Example theme={null}
  .antiraid whitelist @h.azard 1h
  ```
</CodeGroup>

<Frame>
  <img src="https://mintcdn.com/drown/RhXQUEdLw0fdP_5Y/images/Screenshot-2026-04-13-at-11.58.30-PM.png?fit=max&auto=format&n=RhXQUEdLw0fdP_5Y&q=85&s=61cfdb6bad8980693378bba64ea77825" alt="Screenshot 2026 04 13 At 11 58 30 PM" width="1134" height="364" data-path="images/Screenshot-2026-04-13-at-11.58.30-PM.png" />
</Frame>

### Viewing the antiraid configuration

You can use the `antiraid config` command to view the current antiraid configuration.

<Frame>
  <img src="https://mintcdn.com/drown/RhXQUEdLw0fdP_5Y/images/Screenshot-2026-04-13-at-11.59.39-PM.png?fit=max&auto=format&n=RhXQUEdLw0fdP_5Y&q=85&s=0946716d8dd3515ccebf7c2466e06568" alt="Screenshot 2026 04 13 At 11 59 39 PM" width="1150" height="666" data-path="images/Screenshot-2026-04-13-at-11.59.39-PM.png" />
</Frame>

### What to do after a raid

<Steps>
  <Step title="Cleaning up">
    After a raid, it’s recommended to clean up the server by removing all the accounts that joined during the raid, you can do this with the `recentban` and `raid` commands.

    <Info>
      The `duration` parameter must use the proper format, you can learn more here.
    </Info>

    <CodeGroup>
      ```typescript Syntax theme={null}
      .recentban (amount) <reason>
      .raid (duration) (kick or ban) <reason>
      ```

      ```typescript Example theme={null}
      .recentban 50 // Bans the last 50 accounts that joined the server
      .raid 2h ban // Bans all accounts that joined the server in the last 2 hours
      ```
    </CodeGroup>
  </Step>

  <Step title="Disabling the raid state">
    After the raid is over, you can disable the raid state with the `antiraid state` command, this will re-enable events, unlock channels, and allow accounts to join the server.
  </Step>
</Steps>
