Skip to main content

Spam

Plugin name: spam

The spam plugin allows administrators and moderators to limit spam and enforce punishments on spammers. The plugin can be used to limit mass sending of:

  • General Spam
  • Mentions
  • Links
  • Attachments
  • Emojis
  • Newlines
  • Duplicate Messages
  • Upper case letters
caution

This plugin should be enabled in conjunction with the infractions plugin for punishment implementation.

Configuration Options

OptionDescriptionTypeDefault
rolesA mapping of roles to spam configurations.dictempty
levelsA mapping of levels to spam configurations. This will match any user with a level that is equal or below.dictempty

Spam Configuration

OptionDescriptionTypeDefault
max_messagesMax count of messages that can be sent in interval. Requires a check subconfiguration.dictempty
max_mentionsMax count of user mentions that can be sent in interval. Requires a check subconfiguration.dictempty
max_linksMax count of links that can be sent in interval. Requires a check subconfiguration.dictempty
max_upper_caseMax count of upper case letters (does not have to be consecutive) that can be sent in interval. Requires a check subconfiguration.dictempty
max_emojisMax count of emojis that can be sent in interval. Requires a check subconfiguration.dictempty
max_newlinesMax count of new lines/line breaks that can be sent in interval. Requires a check subconfiguration.dictempty
max_attachmentsMax count of attachments that can be sent in interval. Requires a check subconfiguration.dictempty
max_duplicatesMax count of duplicate messages that can be sent in interval. Requires a check subconfiguration.dictempty
punishmentSets a punishment when spam detection is triggered. Options: NONE, MUTE, TEMPMUTE, BAN, TEMPBAN, KICKstrNONE
punishment_durationRequired for TEMPBAN and TEMPMUTE punishments. Seconds that a punishment should last.int300
channel_whitelistList of whitelisted channels that will not trigger spam detection for the action.list(snowflake)[]
cleanWhether or not messages that triggered the spam filter should be deleted.boolfalse
clean_countMaximum number of messages to be deleted.int100
clean_durationDuration in seconds in which messages should be deleted.int900
info

The censor plugin also has an all_caps filter similar to the max_upper_case spam filter that is more configurable.

caution

Please note that the message deletion on the spam plugin if clean is enabled is different than the censor plugin. The spam plugin will delete all messages by the user in the clean_duration up to a max of clean_count once it is triggered, whether or not all messages were specifically violating the spam trigger. The censor plugin deletes more selectively with single messages that violate the censor.

Check Subconfiguration

OptionDescriptionTypeDefault
countNumber of times an action is performed in interval to trigger the punishment.intN/A
intervalSeconds within which a user with over count actions will trigger a punishment.intN/A
punishmentSets a punishment when spam detection is triggered. If unset, it will use the overall configuration setting by default. Options: NONE, MUTE, TEMPMUTE, BAN, TEMPBAN, KICKstrunset
punishment_durationRequired for TEMPBAN and TEMPMUTE punishments. Seconds that a punishment should last. If unset, it will use the overall configuration setting by default.intunset
channel_whitelistList of whitelisted channels that will not trigger spam detection for the action.list(snowflake)[]

Configuration Example

plugins:
spam:
levels:
49:
punishment: TEMPMUTE
punishment_duration: 120
clean: true
clean_count: 50
clean_duration: 500
channel_whitelist: [390107999022350336]
max_newlines:
count: 60
interval: 120
channel_whitelist: [439205512425504771]
max_duplicates:
count: 5
interval: 30
channel_whitelist: [439205512425504771]
roles:
580569967364407316:
punishment: NONE
punishment_duration: 10
clean: true
max_mentions:
count: 3
interval: 30
infractions:
mute_role: 579398816072073246