How to set up a Discord anti-raid bot

Updated · 10 min read

A raid response should be planned before a join surge makes decisions harder. Build Discord Bots includes an Anti-Raid module with join-rate detection, an account-age filter, a username filter, verification roles, an alert channel, and a choice of lockdown, kick, or ban when a configured threshold is reached. This guide uses the dashboard for the long-lived settings and a small, reversible Discord test for the emergency control. Anti-Raid is a Pro module.

Start free

Start free. Pro is $9.99/month.

Before you start

  1. Enable the module for the right server

    Open the bot in the dashboard, select Modules, turn on Anti-Raid, and use the card gear button to open Settings. Select the server in the Server selector before changing any control. Anti-Raid settings are saved per server, so a setting for a test community does not protect another community where the same bot is present. Wait for the bot to be online if enabling the module causes it to restart. The Enable Anti-Raid switch turns the checks on or off for that selected server; leave it off while you are still deciding thresholds.

    This module is not a substitute for Discord permissions, moderator judgment, or an incident plan. It reacts to the conditions you configure: a rapid join rate, an account age rule, or a matching username filter. Start with values that fit ordinary joins in your own community. A launch announcement, partner event, or migration can legitimately bring many people at once, so a threshold copied from another server may create unwanted action. Write down who can turn protection off and how staff will communicate with members during a real event.

  2. Choose an Anti-Raid Log Channel

    In Anti-Raid Log Channel, select a private moderator channel. This is where the module posts alerts and actions. None means logging is disabled, which makes it harder for staff to see what happened after a threshold is reached. The bot needs access to the selected channel even when the channel is hidden from normal members. If the channel list does not load, use a channel ID only after confirming it belongs to the selected server; an ID from another server cannot become a useful destination for this configuration.

    Keep the log channel readable to the people who will respond, not necessarily every moderator. A useful operating habit is to pin a short incident note there: where to coordinate, which permissions are safe to change, and how to unlock the server if needed. The guide cannot choose that policy for you. The product records its alerts in the selected channel, but it does not turn an empty log channel into a staffed response team. Save after selecting the channel so the bot receives the current setting.

  3. Set join-rate detection and a response

    Turn on Enable Join Rate Limit, then set Max Joins In Window and Join Window (seconds). The join threshold is the number of joins inside that timeframe that triggers the raid response. Select the Raid Action deliberately: Lockdown Server, Kick New Joins, or Ban New Joins. Lockdown is the reversible option when you want staff to investigate before removing people. Kick and ban affect new joining members, so test them only in a controlled server and use numbers that accommodate your normal traffic pattern.

    The dashboard also exposes the same state through Discord commands. `antiraid` views or configures anti-raid settings, while `raidaction lockdown` chooses lockdown as the detection response. Do not treat a command example as a recommendation for every community: the command changes the saved behavior for the server where it is run. A good first configuration is one a moderator can explain: what number of joins matters, how long the window is, who sees the alert, and whether the first automated action is reversible.

  4. Add account-age and username checks carefully

    Enable Account Age Filter only if your community has decided that recently created accounts should be blocked. Set Minimum Account Age (hours) and choose the Account Age Action, kick or ban. The optional Account Age DM Message is sent when possible, but direct messages can be closed, so do not rely on it as the only explanation. A strict age setting can exclude legitimate newcomers who made a Discord account for your server. Test with a disposable test account only when you understand the effect of the selected action.

    Enable Username Filter when you have specific names or phrases you want checked on join, then add only terms your team has reviewed. The module checks username and display/global name against the blocked username words. It normalizes common spacing and lookalike bypasses, but that is not a reason to add broad words that could catch ordinary members. `namefilter` manages the saved list and `accountage` changes the age rule in Discord; both are staff controls, not member commands. Keep a written appeal or correction path for a legitimate person who is blocked.

  5. Optionally use a verification role

    Enable Verification System if you want new members to receive an unverified role until staff verify them. Choose an Unverified Role and a Verified Role from roles below the bot’s highest role. The module assigns the unverified role on join and the verified role when an authorized staff member verifies that member. Decide the permissions of those roles before activating the switch: an unverified role is useful only when your channel and role permissions actually limit access in the way you intend.

    In Discord, `verification` configures the verification system and `verify` grants the verified role to a member when used by someone with Manage Roles. Run a test with a staff-controlled account that has no special role, then inspect both the role assignment and the channels the account can see. Do not test by changing a real member’s access without telling them. If Discord refuses a role assignment, move the bot role above the target role and check its Manage Roles permission before retrying.

    If staff cannot verify everyone in time, turn on Kick members who do not verify and set Verification deadline (minutes), from 5 minutes to 24 hours (15 by default). It is off by default and applies only to members who join after you turn it on: there is no backfill, and turning it off then on clears pending members. When the deadline passes, the bot kicks, never bans, only members still missing the Verified Role. It needs Kick Members, and it skips bots, the server owner, Administrators, Manage Server members and anyone whose role is at or above the bot’s. Optional DM before kick is sent first when Discord allows it, and Optional timeout log channel gets a line both when a member is kicked and when one is not. Test it with a short deadline and a staff-controlled account before relying on it.

  6. Set up the Anti-Raid honeypot channel

    The Anti-Raid honeypot is a Pro, opt-in tripwire: a regular text channel where a non-exempt human posting message is treated as a moderation event. It does not trigger when someone merely joins the server. The handler deletes the post and then applies the selected action—Quarantine (time out), Kick, or Ban. Bots, the server owner, Administrators, members with Manage Messages, and members with an exempt role are skipped. Anti-Raid itself must also be enabled for the honeypot to act.

    To create the marked channel, use `/antiraid honeypot action:create` in Discord as the server owner or someone with Manage Server. The bot creates the do-not-post channel, adds a warning, pins it, and leaves the honeypot disabled. In the dashboard, open Anti-Raid Settings for the same server, turn on Enable honeypot, choose Honeypot text channel, and select Quarantine (time out), Kick, or Ban under Action after deleting the message. If you choose quarantine, set Timeout duration (minutes); the shipped default is 60 minutes and the allowed range is 1–40,320. Add Exempt roles when staff or trusted roles should be ignored, then save.

    Select an Anti-Raid Log Channel before testing. The log records the member, action, first 100 characters and time; with quarantine it includes a Release button for staff with Moderate Members while the timeout is current. A member can receive one action per 10 minutes; later posts in that window are still deleted. The bot needs Manage Messages plus the permission for the selected action, and a missing permission produces a warning without deleting or moderating. Existing bots need regeneration to receive this feature.

  7. Test the reversible emergency control

    Use a test server or a quiet test channel configuration to check the emergency control. Run `lockdown on` from an account with Manage Server and inspect the affected channel permissions before inviting anyone. Then run `lockdown off` and confirm that normal access returns. This is safer than trying to manufacture a real raid just to see a threshold fire. The lockdown command is an immediate staff control; it can be useful even when the automatic join-rate response is switched off while you tune values.

    When the test is complete, turn Enable Anti-Raid on, save the selected server, and make sure the bot remains online. Review the log channel after any real alert and adjust only from observed server behavior. If a response is too aggressive, disable the relevant check, resolve the situation, and choose a less disruptive configuration. Build Discord Bots can host the module, but it cannot know which join surge is welcome or which moderation action fits your community. Revisit the settings before large events rather than changing them in panic.

Frequently asked questions

Is Anti-Raid included on the Free plan?

No. Anti-Raid is a Pro module; keep your account on Pro if you need it to remain active.

How do I set up a Discord honeypot channel?

Anti-Raid includes a Pro honeypot channel. Run `/antiraid honeypot action:create` with Manage Server to create the do-not-post channel, then select it in Anti-Raid Settings, enable the honeypot, choose Quarantine, Kick, or Ban, and save. A non-exempt human post is deleted before the selected action; it does not trigger on a join alone.

What does a Discord honeypot bot do here?

It treats a post in the selected honeypot text channel as a moderation tripwire. Bots and configured exemptions are skipped; other human posts are deleted and trigger the saved action. Quarantine can be released by staff from the Anti-Raid log while its timeout is current.

What does lockdown do?

The lockdown command enables or disables the module’s server lockdown control. Check the resulting channel permissions in a test server before relying on it during an incident.

Can the bot verify members automatically?

The module can assign an unverified role on join and authorized staff can use verify to give the verified role. The staff verification decision remains yours. If you turn on Kick members who do not verify, the bot kicks, never bans, members who joined after you turned it on and still lack the Verified Role when the deadline passes.

Ready to configure your bot?

Start free

Start free. Pro is $9.99/month.