Guide/Protect your server/Anti-raid & join gate
Discord Anti-Raid Bot & Join Gate Setup
Join-flood detection with a risk score per account, and the join-gate rules applied to every newcomer.
Quick answer
Typical mid-size server
!antiraid enable
!antiraid threshold 10 30
!antiraid action quarantine lock_on_raid:false
!security set antiraid.pauseInviteOnRaid on # delete the invite the raid is using
!antiraid risk medium:40 high:70 min_account_days:7
!antiraid joingate accountAge on quarantine value:3
!antiraid joingate unauthorizedBots on kickAsk the guide
Step by step
Raid detection
A raid starts when more than joins members arrive within window seconds (default 10 in 30 s). Each joining account gets a risk score 0β100 from account age, default avatar, name patterns and whether the invite was created moments ago. Accounts above the high threshold receive the raid action; medium-risk ones are flagged in the alert.
!antiraid enable
!antiraid threshold 10 30
!antiraid action quarantine lock_on_raid:true timeout / kick / ban / quarantine / alert only
!antiraid risk medium:40 high:70 min_account_days:7
!antiraid statusLock on raid locks the server for the configured duration (10 minutes by default) and posts a staff alert; !unlockall ends it early. During a raid the temporary-voice creator channels can be paused too (Temporary voice β Pause during lockdown).
Join gate rules
| Rule | Trigger | Value |
|---|---|---|
noAvatar | Account uses the default avatar | β |
accountAge | Account younger than N days | days |
unauthorizedBots | A bot was added by someone who is not whitelisted for joingate (or all) | β |
inviteInName | discord.gg / invite link in the username or display name | β |
usernamePattern | Username matches a regular expression | regex |
!antiraid joingate accountAge on quarantine value:7
!antiraid joingate unauthorizedBots on kick
!antiraid joingate usernamePattern on timeout value:"(?i)nitro|free\s*gift"Actions for join gate: none, timeout, kick, ban, quarantine. To allow a specific person to add bots: !whitelist add user @them joingate. To allow a specific bot: !whitelist add bot <bot id> joingate.
Copy and try
Typical mid-size server
!antiraid enable
!antiraid threshold 10 30
!antiraid action quarantine lock_on_raid:false
!security set antiraid.pauseInviteOnRaid on # delete the invite the raid is using
!antiraid risk medium:40 high:70 min_account_days:7
!antiraid joingate accountAge on quarantine value:3
!antiraid joingate unauthorizedBots on kickGood to know
- Medium must stay below high.
- Lock on raid also locks out real newcomers; cohorts contain without locking, which is usually what you want.
If it does not work
- Real people got quarantined during a shout-out. Check !raid cohorts: a genuine influx should be judged "surge"; if not, raise the join limit or turn lock_on_raid off.
Still stuck? Ask in the support server.