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

# Anti-Raid & Threat Mitigation

> Real-time containment and automatic state reconstruction.

# Anti-Raid & Anti-Nuke Architecture

MyProtect's Anti-Raid engine is designed to operate autonomously during high-velocity attacks. When a rogue administrator, compromised staff token, or bot swarm initiates unauthorized destructive actions, MyProtect detects the threshold violation within milliseconds, quarantines the perpetrator, and restores the deleted infrastructure.

***

## Protected Threat Vectors

The Anti-Raid module monitors the Discord Gateway event stream for dangerous spikes across multiple operational vectors:

| Protection Vector | Threshold Logic | Automated Response |
| :- | :- | :- |
| **Mass Channel Deletion** | $> 2$ channels deleted within $10\text{s}$ | Revoke perpetrator roles + reconstruct channel hierarchy |
| **Mass Role Deletion** | $> 2$ roles deleted within $10\text{s}$ | Revoke perpetrator roles + recreate roles & permissions |
| **Mass Ban / Kick Wave** | $> 3$ bans or kicks within $10\text{s}$ | Strip administrative permissions + quarantine actor |
| **Webhook Flood** | $> 3$ webhooks created/deleted | Delete unauthorized webhooks + revoke token |
| **Server Name / Icon Tampering** | Unauthorized guild update | Instant rollback to last verified server metadata |
| **Raid Join Waves** | $> 10$ joins within $30\text{s}$ | Trigger temporary entrance lockdown (Anti-Mass Join) |

***

## State Reconstruction & Rollback

Unlike legacy bots that only ban the attacker while leaving your server in ruins, MyProtect maintains **continuous structural snapshots**:

```text theme={null}
[ Rogue Admin deletes #announcements ]
               │
               ▼
   [ Gateway Event: channelDelete ]
               │
               ▼
   [ Threshold Exceeded Check: TRUE ]
               │
   ┌───────────┴────────────────────────┐
   ▼                                    ▼
[ Revoke Rogue Roles ]         [ Recreate #announcements ]
   │                                    │
   ▼                                    ▼
[ Dispatch Discord Audit Alert ] [ Restore Permissions & Topics ]
```

1. When a channel or role is deleted during a flagged raid event, MyProtect queries its local database cache for the exact metadata: name, type, topic, parent category, bitrate, and permission overwrites.
2. The bot recreates the deleted entity via the Discord REST API with the original permission matrix intact.
3. A priority alert is dispatched to your server's security log channel with forensic details (actor snowflake, IP/session indicators where available, and timestamp).

***

## Panic Mode

When an unpredictable or severe incident occurs, staff can immediately engage **Panic Mode** via Discord or the Web Dashboard:

```bash theme={null}
/antiraid panic enable
```

### Panic Mode Behaviors:

* **Zero Ingress**: All new incoming members are automatically kicked or placed in an isolated quarantine holding room.
* **Invite Invalidation**: All active server invite links are temporarily paused or revoked to stop raid propagation.
* **Message Rate Limiting**: Global slowmode (15 seconds) is enforced across all public discussion channels.
* **Staff Verification Required**: Administrative actions can only be unlocked via DAC v2 verification.

***

## Incident Simulation Mode

Administrators can test their defense configuration without damaging production channels by running **Simulation Mode**:

```bash theme={null}
/antiraid simulation start
```

In simulation mode, MyProtect evaluates live actions against protection thresholds and logs exact hypothetical containment responses without executing destructive bans or role modifications, allowing staff to tune sensitivity thresholds with confidence.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.