Documentation menu

Docs/Plugins/Spam

Spam

Rate-based anti-spam with per-level and per-role rules and automatic punishment.

The spam plugin counts behaviour over time windows and punishes members who exceed your limits. It is bucket-based: each rule tracks its own window, and a member trips the rule by going past its count within its window of seconds.

Everything here is set up in the Spam form on the dashboard's Setup > Filters page. Pick a Rule set - a member level or a role - then give each check a count and a window, and choose what happens when one trips.

Setup checklist

  1. Open Setup > Filters and, in the Spam form, pick the Everyone rule set (level 0). Turn on one check with a generous count and a short window.
  2. Leave Punishment when tripped on NONE for the first test. Turn on "Delete the spammer's recent messages when a rule trips" only in a private channel where deleting the test messages is safe.
  3. Subscribe a mod log channel to Spam violation so every trip is visible even without punishment.
  4. Save, run Diagnostics, and use the message simulator to see which counters one test message increments.
  5. As a level 0 test member, cross the threshold. Confirm the violation log and optional cleanup.
  6. Add the intended punishment and duration. Test again before expanding the rule to busy channels.

Each check takes a count and a window in seconds. A check trips when the member goes past the count inside that window.

Tuning individual rules

Every check has an Options panel. Give one its own Punishment for this rule, duration, or channels it ignores, and that check overrides the rule set's default - so you can mute for mention floods while merely cleaning up on link spam. Leave its punishment on Same as the rule set to inherit.

Two values worth knowing:

  • NONE as the punishment detects and cleans without punishing anyone, which is the safe way to trial a new limit.
  • A count or window of 0 switches a check off without deleting it.

Scoping

Rule sets come in two kinds, and a member is checked against every rule set that matches them, each on its own:

  • Member levels - a level's rules apply to members at or below that level. Everyone (level 0) therefore means regular members only: trusted members, mods and admins are above it and are never checked by it. Add rules under Mods or Admins only if staff should be rate-limited too.
  • Roles - Add rules for a role applies to anyone holding that role, staff included. Every member applies one rule set to every member, staff included.

Each rule set can also list channels it ignores (a listed channel's threads and forum posts are ignored with it).

The rules

Each of these takes a count and a window:

  • Max messages - raw message rate.
  • Max mentions - user/role mentions. Only mentions that actually ping count: a reply with reply-pinging turned off adds nothing, while a reply that pings the original author counts as one mention.
  • Max duplicate messages - repeated identical messages.
  • Max links, Max attachments, Max line breaks, Max capital letters - exactly what they say.
  • Max custom emoji - counts your server's custom emoji only, not standard emoji.

Punishment and cleanup

  • Punishment when tripped - what happens on a trip (MUTE, TEMPMUTE, KICK, TEMPBAN, BAN, or NONE), with a duration for the timed ones. Punishments create real infractions, so they show in the mod log and expire automatically.
  • Every trip also logs the Spam violation mod log event (which rule tripped and why), whether or not a punishment is configured - enable it in your mod log channel's event picker to see spam hits as they happen.
  • Delete the spammer's recent messages when a rule trips - removes the member's messages from the last From the last (s) seconds, Up to (per channel) messages in each channel, across every channel they posted in during that window.

Testing

The Setup → Filters message simulator includes spam: it lists every rule that would count a given message and the per-message cost, so you can sanity- check thresholds before a raid does it for you. Each rule shows the config key it comes from (for example plugins.spam.levels.50.max_mentions), so tuning it is a straight lookup in your config.

Troubleshooting

  • A moderator cannot trigger the test: level rules under Everyone never apply to staff. Test with a regular account, or add a role rule set.
  • Detection logs but nobody is punished: NONE is detection-only, and a per-rule punishment overrides the surrounding level or role default.
  • A timed mute or ban fails: set the corresponding duration and check the infractions plugin, mute role, Discord permission, and role hierarchy.
  • Cleanup misses old messages: it only removes messages inside the window you set, and at most the per-channel number. It looks back through up to 1,000 recent messages in each channel, so in an extremely busy channel a message older than that backlog is out of reach.
  • A channel appears exempt: check both the rule set's ignored channels and the check's own Options.