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

# Anti-Raid Mode

> Emergency lockdown that blocks all new member joins during a raid.

Anti-Raid Mode is an emergency lockdown for your server. When activated, every new member who tries to join is immediately kicked or banned — stopping raid attacks in seconds instead of minutes.

<Check>
  Free for all servers. One command or one button to activate. Auto-expires so you can't accidentally leave it on.
</Check>

### How It Works

1. A moderator activates lockdown via `/lockdown activate` or the dashboard
2. **All new joins are immediately blocked** — kicked or banned on arrival
3. Allowlisted members and Hashbot managers pass through unaffected
4. Existing members are completely unaffected
5. Lockdown automatically expires after the configured duration

Actions are logged to your server's log channel with the lockdown start/end times and the number of joins blocked.

<Warning>
  This is a high-impact action. The `/lockdown activate` command requires a confirmation button click, and the dashboard requires you to type **LOCKDOWN** to confirm. This prevents accidental activation.
</Warning>

### Activating Lockdown

#### From the Dashboard

<Steps>
  <Step title="Open the Dashboard">
    Go to [dashboard.hashbot.com](https://dashboard.hashbot.com) and select your server.
  </Step>

  <Step title="Navigate to Anti-Raid">
    Click **Anti-Raid** in the sidebar under Hashbot.
  </Step>

  <Step title="Choose Action and Duration">
    Select whether to **Kick** (members can rejoin later) or **Ban** (permanent) new joins, and how long the lockdown should last.
  </Step>

  <Step title="Activate">
    Click **Activate Lockdown**. A confirmation modal will appear — type **LOCKDOWN** (case-insensitive) to confirm. The lockdown takes effect immediately.
  </Step>
</Steps>

While active, the dashboard shows a live status card with:

* A countdown timer
* The number of joins blocked so far
* A **Deactivate** button to end lockdown early

#### From Discord

```
/lockdown activate
```

The bot will display a warning embed summarizing what will happen, with **Activate Lockdown** and **Cancel** buttons. Click **Activate Lockdown** to confirm.

You can also specify the action and duration:

```
/lockdown activate action:Ban duration:30
```

<Tip>
  The `action` and `duration` parameters are optional. If omitted, Hashbot uses your server's configured defaults (Kick + 1 hour by default). You can change these defaults on the dashboard.
</Tip>

### Deactivating Lockdown

Lockdowns automatically expire after the configured duration. To end one early:

**From the dashboard:** Click the **Deactivate Lockdown** button on the Anti-Raid page.

**From Discord:**

```
/lockdown deactivate
```

When a lockdown ends (manually or by expiry), a summary is posted to your log channel showing how many joins were blocked and how long the lockdown lasted.

### Checking Status

```
/lockdown status
```

Shows whether a lockdown is active, the action being taken, time remaining, joins blocked, and who activated it. Visible only to the person who runs the command.

### Auto-Trigger

Hashbot can automatically activate lockdown when it detects a join rate spike — no moderator action needed. Configure it on the **Anti-Raid** page in the dashboard under **Auto-Trigger**.

| Setting               | Default    | Range            | Description                                |
| --------------------- | ---------- | ---------------- | ------------------------------------------ |
| **Join threshold**    | 20         | 3 – 100          | Number of joins that triggers lockdown     |
| **Time window**       | 10 seconds | 5s – 5 minutes   | How fast the joins must happen             |
| **Lockdown duration** | 1 hour     | 1 min – 24 hours | How long the auto-triggered lockdown lasts |

<Info>
  Auto-triggered lockdowns use the default action (Kick or Ban) from your Default Settings. They appear in your log channel with source "AUTO\_TRIGGER" so you can distinguish them from manual activations.
</Info>

### Configuration Options

| Setting      | Default | Range            | Description                                      |
| ------------ | ------- | ---------------- | ------------------------------------------------ |
| **Action**   | Kick    | Kick or Ban      | What happens to members who join during lockdown |
| **Duration** | 1 hour  | 1 min – 24 hours | How long the lockdown lasts before auto-expiring |

These defaults are used when you run `/lockdown activate` without specifying parameters. Change them on the **Anti-Raid** page in the dashboard under **Default Settings**.

### Who Is Exempt

Even during an active lockdown, these members can still join your server normally:

* Members on the **Allowlist** (users or roles)
* **Hashbot Managers** (server owners, admins, and users with manager roles)
* **Bots** added via OAuth

Everyone else is kicked or banned immediately on join.

### Commands

| Command                                     | Description                             |
| ------------------------------------------- | --------------------------------------- |
| `/lockdown activate`                        | Activate lockdown with server defaults  |
| `/lockdown activate action:Kick`            | Activate with kick action               |
| `/lockdown activate action:Ban duration:30` | Activate with ban action for 30 minutes |
| `/lockdown deactivate`                      | End the active lockdown early           |
| `/lockdown status`                          | View current lockdown status            |

### Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What happens if the bot restarts during a lockdown?">
    The lockdown persists across bot restarts. Active lockdowns are stored in the database and automatically restored when the bot comes back online. Any lockdowns that expired during downtime are cleaned up automatically.
  </Accordion>

  <Accordion title="Can I change the action or duration while a lockdown is active?">
    No. You need to deactivate the current lockdown first, then activate a new one with different settings. This is intentional — changing a mass action mid-lockdown could cause confusion.
  </Accordion>

  <Accordion title="Does lockdown affect existing members?">
    No. Lockdown only affects **new joins**. Existing members can continue using the server normally. Member updates (name changes, role changes) are also unaffected.
  </Accordion>

  <Accordion title="Is Anti-Raid Mode a premium feature?">
    No. Anti-Raid Mode is free for all servers. Emergency raid protection shouldn't be gated behind a subscription.
  </Accordion>

  <Accordion title="What's the difference between Anti-Raid Mode and Verification?">
    **Anti-Raid Mode** is a blunt emergency tool — it blocks all new joins entirely. Use it when a raid is actively happening and you need to stop the bleeding immediately.

    **Verification** is a persistent gate — new members must pass a CAPTCHA before accessing channels. Use it as an always-on first line of defense.

    They work well together: Verification as your daily protection, Anti-Raid Mode as your panic button.
  </Accordion>

  <Accordion title="How do I know the lockdown expired?">
    Hashbot posts a summary to your log channel when a lockdown ends, whether by expiry or manual deactivation. The summary includes the total joins blocked and the lockdown duration.
  </Accordion>
</AccordionGroup>
