Anti-spam and links

Discord Anti-Spam Setup: Stop Floods, Mention Spam, and Repeat Posts

Anti-spam on Discord works in layers. AutoMod blocks mention spam, spam content, and flagged words before a message posts. Slowmode caps how fast each member can post. A flood detector such as Security Bot's anti-spam (Premium) counts every message in a channel over a time window. At your limit, it locks the channel and deletes the burst.

By Sina, Founder, Security BotUpdated (published )10 min read

The three kinds of spam

TypeWhat it looks likeBest layer
Mention spam@everyone, @here, or ten members pinged in one message, often repeatedAutoMod Mention Spam rule; Security Bot's Anti Mention Spam trigger for repeat @everyone and @here pings
FloodsDozens of messages in seconds, same or different textSlowmode; flood detector with channel lock
Content spamScam links, copy-pasted promotions, flagged wordsAutoMod Spam Content and flagged words, Discord's suspicious-link filter, Threat Link Guard

Layer 1: Discord AutoMod

Discord's AutoMod is the only layer that blocks a message before it exists, so it should carry as much of the load as possible. You can create the rules yourself in Server Settings, AutoMod. On Premium, Security Bot creates them from presets on its AutoMod page and can add a bot-side punishment after the block.

  • Mention Spam: set a mention limit (5 is a reasonable start) and turn on mention-raid detection. Discord can time the member out automatically on this rule.
  • Spam Content: Discord's own model for suspected spam, which also catches common "free Nitro" and invite spam.
  • Commonly Flagged Words: profanity, slurs, and sexual content categories, with allow terms for your context.
  • Custom Words: your own block terms and regex, up to six keyword rules per server.

With Security Bot presets, choose delete only for each one, or delete plus a bot timeout (a few minutes is often enough for a spam run), kick, or ban.

Layer 2: Slowmode

Slowmode is a per-channel cooldown between messages. A 3 to 5 second slowmode in busy public channels caps how fast any one account can post while barely affecting conversation. Set it in the channel settings under Overview, Slowmode.

Since February 23, 2026, only roles with the Bypass Slowmode permission skip it. Manage Messages, Manage Channel, and Manage Threads no longer do. Give Bypass Slowmode sparingly.

Layer 3: Flood detection with channel lock

AutoMod judges one message at a time. It cannot tell that the tenth message in five seconds is a problem. Security Bot's anti-spam (Premium) counts every message posted in a channel inside a time window, from all members together.

  • Other bots and webhooks are counted. Only Security Bot's own messages are ignored.
  • It looks at the last 99 messages.
  • It runs in regular text channels, not in threads, forum posts, announcement channels, or voice-channel chat.

When the count reaches your limit, the bot deletes those messages and locks the channel (both are on by default). With a lock duration set, the channel reopens on its own when the time runs out. It gets its previous @everyone Send Messages setting back, so the flood stops and the channel reopens clean.

The bot posts a notice in the channel. Nothing is written to Security Bot's logs, and no member is punished.

  1. Start from the default of 20 messages in 8 seconds. The minimum the bot accepts is 5 messages and 8 seconds.
  2. Keep auto lock on and set a lock duration such as 60 seconds. At the default of 0, the channel stays locked until someone runs /unlock.
  3. Decide on auto clear, which is also on by default. It deletes every message in the window, including ones from members who were just chatting.
  4. Watch busy channels for a week. If normal conversation trips it, raise the limit, or add that channel to the Channels: Spam whitelist so anti-spam ignores it.

The flood detector counts per channel, not per member. A busy channel full of real members can trigger it just as one spammer can. Set the limit above your busiest channel's normal peak.

Repeat offenders and mention raids

A member who mass-mentions again after a timeout is a pattern, not an accident. The Premium Anti Mention Spam trigger in anti-nuke sets a per-user limit on @everyone and @here pings. Counters reset every 10 minutes, and Administrators are exempt. When the count reaches the limit, it applies a kick, ban, or clear roles. New Premium servers start with it on at a limit of 8.

  1. Turn on the native AutoMod rules

    Create a Mention Spam rule (a limit such as 5, with mention-raid detection on) and a Spam Content rule. These block before the message posts. On Premium, Security Bot's AutoMod page creates them for you as the Block Mention Spam and Block Suspected Spam Content presets. On the free tier, set them up in Server Settings, AutoMod.

  2. Add flagged words

    Enable Commonly Flagged Words with the categories your community needs, and add allow terms for words that are fine in your context.

  3. Check the flood detector

    On Premium, anti-spam starts on: 20 messages in 8 seconds per channel, with auto clear and auto lock on. On the Anti-Spam page, adjust how many messages a channel may receive inside the time window. The bot will not accept fewer than 5 messages or a window shorter than 8 seconds.

  4. Set a lock duration

    The lock duration starts at 0, which keeps a flooded channel locked until someone runs /unlock. Set it to something like 60 seconds so the channel reopens on its own with its previous Send Messages setting.

  5. Set slowmode on the busiest channels

    In the channel settings, a 3 to 5 second slowmode caps how fast each member can post. Only roles with the Bypass Slowmode permission skip it.

  6. Watch the results

    Assign the AutoMod log channel on the Logging page and review false positives weekly. Anti-spam locks are not written to a log. The bot posts a notice in the locked channel.

Example configuration: a 5,000-member gaming server

This is an illustration, not a real server. It shows how the layers fit together for a public gaming community on Premium. Every value lives on the Security Bot dashboard or in Discord's channel settings.

  • AutoMod page: Block Mention Spam on, limit 5, mention-raid detection on. Block Suspected Spam Content on. Block Commonly Flagged Words on with the slurs category, plus allow terms for two game names that trip it. Each preset set to delete plus a 10-minute bot timeout. Staff role exempt.
  • Anti-Spam page: 20 messages in 8 seconds, auto lock on with a 60-second lock duration, auto clear on.
  • Whitelists page: #counting in the Channels: Spam category, because fast bursts are normal there.
  • Channel settings: 3-second slowmode on #general and #lfg, none on staff channels.
  • Logging page: AutoMod log routed to a private staff channel.

When a spam run hits, messages with mass mentions or flagged words never post. If the accounts switch to plain text, #general may receive twenty messages inside eight seconds. Then the channel locks for a minute, those twenty messages are deleted, and the bot posts a lock notice. Members who were mid-conversation lose a few messages and wait sixty seconds.

Common anti-spam mistakes

  • A flood limit below normal traffic. Anti-spam counts everyone in the channel, so a low limit locks the channel every time chat gets lively, during a stream or an announcement. Start at the default and lower it only in quiet channels.
  • Forgetting channels where bursts are normal. Counting games, bot-command channels, and event chats can hit any limit. Add them to the Channels: Spam whitelist instead of raising the limit everywhere.
  • Turning a preset off after one false positive. Add an allow term or an exemption instead. The preset keeps working for everyone else.
  • Bypass Slowmode handed out widely. Since February 23, 2026 it is the only permission that skips slowmode. Give it to the few roles that really need it.
  • A lock with no duration. Anti-spam starts on with auto lock and a lock duration of 0, which leaves a flooded channel locked until someone notices. Set a duration.
  • Expecting AutoMod to stop floods. It judges one message at a time. Volume over time needs the flood detector or slowmode.

What Discord provides and what needs a bot

JobDiscord nativeWith Security Bot
Block a message by content before it postsAutoMod keyword, spam, mention, and flagged-word rulesPresets that create and sync those rules (Premium)
Cap posting speed per memberSlowmodeNothing extra; slowmode is the right tool
Detect a burst across a whole channelNothingFlood detector that counts every message in the channel across a window (Premium)
Lock a flooded channel and delete the spamManual Send Messages deny and message deletionAuto lock and auto clear, with a notice in the channel (Premium)
Punish repeat mass-mentionersAutoMod Mention Spam can time out automaticallyAnti Mention Spam trigger with kick, ban, or clear roles for @everyone and @here pings (Premium)
See what happened afterwardsAutoMod alert channel and the audit log (45 days)Moderation, security, and AutoMod log channels in your own server

Use the native layer for everything it can do. It is free, and it runs before the message exists. Add the bot for the parts that need counting, locking, or a record. The AutoMod vs Security Bot guide goes deeper.

During an active spam attack

  1. Lock the channel. Run /lock in the flooded channel, or /lockall if it is everywhere. Auto lock may already have done this. Look for the bot's lock notice in the channel.
  2. Clear the mess. /clear amount:100 removes up to the last hundred messages in the channel. For a compromised member account, /softban user:@member deletes their recent messages from every channel at once.
  3. Check where the accounts came from. New joins posting spam are a raid. On Premium, let anti-raid punish the accounts that joined in the raid window. An established member is probably compromised. Softban them and tell them to secure the account.
  4. Tighten temporarily. Raise slowmode to 10 seconds on the affected channels and lower the flood limit until the wave ends.
  5. Reopen. Run /unlock, or /unlockall to reopen every channel Security Bot locked. Each gets its previous Send Messages setting back, so read-only channels stay read-only. Then review the AutoMod log for domains to add to a keyword rule.

Suggested starting values by server size

These are starting points to adjust after a week, not product defaults. The flood limit is per channel, so tune it to your busiest channel rather than to member count.

ServerMention limitFlood limit (per channel)SlowmodeFollow-up
Under 1,000 members520 in 8s (default); quiet servers can go lower, down to 5 in 8sNone or 2sTimeout 5m, lock 60s
1,000 to 20,000520 in 8s; whitelist channels where bursts are normal3s in general channelsTimeout 10m, lock 60s
20,000+3Raise above 20 if busy channels lock during normal chat5s in general channelsTimeout 1h, lock 120s, ban on repeat

Free versus Premium

LayerFreePremium ($4.99 per month per server)
Native AutoMod rules and slowmode, set up by hand in DiscordYesYes
Security Bot AutoMod presets: mention spam, spam content, flagged words, custom wordsNoYes
Anti Invite Link filterYesYes
Flood detector with auto lock and auto clearNoYes
Anti Mention Spam triggerNoYes
Threat Link Guard scam domain feedNoYes
Beast Mode escalationYesYes

A free server still gets the layer that matters most: message-level blocking. Set up Discord's AutoMod and slowmode directly, and add Security Bot's free invite filter. Premium adds the presets, the volume detection, and the automatic lock.

Do this with Security Bot

Discord Anti Spam Bot: Catch message floods, clear them, and lock the channel before spam takes over.

Security Bot is a Discord anti spam bot that counts the messages a channel gets in a short window. When a flood crosses your limit, it deletes the burst and locks the channel. Mention spam is handled by the anti-nuke mention trigger and AutoMod.

Frequently asked questions

How do I set up anti-spam on Discord?

Turn on AutoMod mention spam and spam content rules, and add slowmode to busy channels. Then run a flood detector that locks a channel when it receives too many messages in a short window. Security Bot's Premium handles the presets and the flood detector from one dashboard.

Is Discord AutoMod enough for spam?

It blocks individual messages well but cannot detect floods or lock a channel. Pair it with slowmode and a flood detector.

What is a good flood limit?

Security Bot's default is 20 messages in 8 seconds, and it will not accept fewer than 5 messages or less than 8 seconds. Because the count covers every message in the channel, set it above your busiest channel's normal peak and adjust after a week.

How do I stop @everyone spam?

Remove Mention Everyone from roles that do not need it. Turn on an AutoMod Mention Spam rule with mention-raid detection. On Premium, use the Anti Mention Spam trigger for repeat @everyone and @here pings.

Is Security Bot anti-spam free?

The invite link filter is free. AutoMod presets, the flood detector with auto lock and clear, and the Anti Mention Spam trigger are on Premium. Free servers can still set up Discord's native AutoMod rules and slowmode by hand.

Can a moderator unlock a channel early after auto lock?

Yes. The bot posts a lock notice in the channel. Run /unlock if it was a false positive. If the lock duration is set, it also reopens on its own. At the default of 0, it stays locked until someone unlocks it.

How this guide was made: drafted with AI assistance, then checked against Security Bot's source code and Discord's official help articles. Spotted something out of date? Tell us in the support server.