πŸŽ‰ Launch offer: the next 5 servers get 30 days free. Claim a spot β†’
All topics & search

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 kick

Ask 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 status

Lock 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

RuleTriggerValue
noAvatarAccount uses the default avatarβ€”
accountAgeAccount younger than N daysdays
unauthorizedBotsA bot was added by someone who is not whitelisted for joingate (or all)β€”
inviteInNamediscord.gg / invite link in the username or display nameβ€”
usernamePatternUsername matches a regular expressionregex
!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 kick

Good 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.

Discord Anti-Raid Bot & Join Gate Setup Β· Sweet