Guide
Set up the spam filter
The spam filter stops members from flooding a channel. It has five separate checks, each with its own switch and its own limit. All of them are off on a new server.
How it works
The spam filter looks at every message a member sends and applies the checks you switched on:
| Check | What it catches |
|---|---|
| Message flooding | Too many messages within a short time |
| Attachment spam | Too many attachments within a short time |
| Newline spam | A message with too many line breaks |
| Excessive caps | A message of some length that is mostly upper case |
| Emoji spam | A message with too many emojis |
There are two switches to be aware of: one for the filter as a whole and one for each check. The filter does nothing until at least one check is on.
Editing a message does not count as a new message. The spam filter is a text check and uses no credits. For an overview of the feature see spam filter.
Set it up in the dashboard
The limits depend on how busy your server is. The [settings reference](/docs/settings) lists the default and the allowed range of each one.
Open Spam protection, Spam filter
In the dashboard, open your server and go to Spam protection, then Spam filter.
Switch the filter on
Turn on Filter spam.
Switch on the checks you want
Under Checks, turn on each check you need and set its limit. Start with message flooding; it covers the most common kind of spam.
Decide on timeouts
Each check has its own Time the member out switch and duration. A timeout stops a flood at once, where deleting alone only cleans up after it.
Add exempt roles
Under Exempt roles, pick the roles the filter should ignore.
Save and test
Choose Save changes, then test with an account that has no exempt role.
The `/settings` command
/settings has the page Invites and spam with a spam filter section where you manage the exempt roles. The checks and their limits are set in the dashboard only. It needs the Manage Server permission.
The same page has a section for the invite filter. See the command reference.
What happens on a violation
- The message is deleted.
- The member is timed out, if the timeout of that check is on.
- A log entry is posted to your log channel, naming the check that fired. See logging.
- Trust is deducted, if you use trust and strikes. Each check is its own violation, and all five are low tier by default. You can change the tier per check or switch one off in the trust settings.
- The member is told about the trust loss, if trust is on and set to tell members. Members who opted in with
/dmsget a direct message. Others get a short channel notice that deletes itself, unless you switched the notice off in General settings.
With trust on, a member who keeps spamming loses trust with every removed message and ends up with a strike, even if no single message would justify one.
Exemptions
The spam filter has exempt roles: members with one of these roles are never checked. Use them for moderators and for bots or roles that post a lot by design, for example an announcements role.
There are no exempt channels. If one channel needs different rules, such as a meme channel where emoji walls are normal, give the members who post there an exempt role or leave that check off.
Spam filter or AutoMod
SfwBot's spam filter and Discord's AutoMod overlap. The spam filter acts after a message is posted and can count messages over time. AutoMod blocks a message before anyone sees it and covers mention spam, which the spam filter does not check. Many servers use both.
Troubleshooting
- Nothing happens. Filter spam is on but no check is. Switch on at least one check.
- A member is never caught. The member has an exempt role.
- Messages are reported but stay. The bot lacks Manage Messages in that channel. Run
/status. - The timeout is not applied. The bot needs the permission to time out members, and its role must be above the member's highest role.
- Normal chat is removed. A limit is too low for your server. Raise it, or switch that check off. Excessive caps and emoji spam are the checks most likely to hit harmless messages.
- No log entries. No log channel is set, or the bot cannot post there.
Common questions
Does the spam filter catch mention spam?
No. Mention spam is handled by Discord's AutoMod, which SfwBot can set up for you. See the AutoMod guide.
Are moderators checked?
Only if they have no exempt role. Add your moderator role to the exempt roles.
Does the spam filter use credits?
No. Only AI scans of media use credits.