Documentation menu

Docs/Plugins/Spam

Spam

Rate-based anti-spam with per-level 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 exceeding count within interval seconds.

plugins:
  spam:
    levels:
      0:                          # rules for everyone at level 0+
        max_messages:
          count: 12
          interval: 10
        max_mentions:
          count: 8
          interval: 10
        punishment: TEMPMUTE
        punishment_duration: 600
        clean: true
        clean_count: 50
        clean_duration: 120
      50: {}                      # mods exempt

Tuning individual rules

Every rule block takes more than count and interval. Give one its own punishment, punishment_duration, or channel_whitelist and that rule overrides the sub-config default - so you can mute for mention floods while merely cleaning up on link spam.

Two values worth knowing:

  • punishment: NONE detects and cleans without punishing anyone, which is the safe way to trial a new limit.
  • count: 0 (or interval: 0) switches a rule off without deleting it.

Scoping

Like censor, rules live in sub-configs keyed by level (levels) or role (roles); an empty higher-level block exempts staff. Each sub-config can also carry a channel_whitelist of places it ignores (a listed channel's threads and forum posts are ignored with it).

The rules

Each of these takes { count, interval }:

  • 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_duplicates - repeated identical messages.
  • max_links, max_attachments, max_emojis, max_newlines, max_upper_case - exactly what they say.

Punishment and cleanup

  • punishment - what happens on a trip (for example TEMPMUTE, MUTE, KICK, TEMPBAN, BAN), with punishment_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.
  • clean - delete the offending backlog: up to clean_count recent messages from the member within clean_duration seconds.

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.