Filters

Understand the range of filters for SajuukBot and the individual configuration settings available.

SajuukBot will be ceasing operations on March 31st 2024, due to a variety of factors. For more information, please refer to the announcement provided on the SajuukBot discord server and your options for migrating to a new bot.

Filters are a lower-level version of the majority of Heuristics in SajuukBot, in that the behaviours caught by them are broadly matched in the same way as those by Heuristics, though there are a few differences:

  • Filters do not punish people beyond putting warning infractions on users. This allows them to be used for simply "noting" spammy types of behaviour without directly performing a punishment action.

  • Some filters exist for which no corresponding heuristic exists, such as the emoji filter.

In general, filters work best as a "early warning system" and can track either bad behaviour in a single message or over multiple messages.

Configuration

This section of configuration needs to be placed under the anti spam module as an indented element. Please see the full basic configuration for more details on how it should be formatted.

  filters:
    enabled: false
    duplicates:
      enabled: false
      clean: false
      trigger: 5
      time: 30
    attachments:
      enabled: false
      clean: false
      trigger: 10
      time: 30
    emoji:
      enabled: false
      clean: false
      trigger: 10
      time: 30
    max messages:
      enabled: false
      clean: false
      trigger: 20
      time: 30
    mentions:
      enabled: false
      clean: false
      trigger: 20
      time: 30
    newlines:
      enabled: false
      clean: false
      trigger: 30
      time: 30

Settings

Each tab contains more details on each setting described in the configuration above

Every section allows an optional level field to be defined. If it is included in the relevant sections, then the bot uses that level to determine if a user has been excluded.

Note that the bot always uses a more specific level definition over more general ones first, so if a level is defined under a specific filter(eg duplicates), that one will be used over any global setting (either within the filters block itself or within the anti spam block).

Core

SettingDescription

enabled

Globally toggles the fiilters system on or off. If this has been disabled, none of the filters will be available.

level

The minimum level at which a user is automatically exempted from the filters functionality.

This setting is optional, but it is also "global" to all filters and will be used if no specific level has been defined in a filter.

Duplicates

SettingDescription

enabled

Toggles the duplicates filter. If this is disabled, repeat messages containing the same content will not be actioned on.

clean

Whether to clean messages. If this is disabled, the filter will not remove the offending messages that caused the filter to be triggered.

trigger

The number of repeat messages that need to be sent to count as having violated the constraints.

time

The amount of time in which the trigger value needs to be reached to count as having violated the constraints.

EG: If trigger equals 5 and time equals 30, that means 5 duplicates need to be sent within 30 seconds to cause the bot to take action.

Attachments

SettingDescription

enabled

Toggles the attachments filter. If this is disabled, messages with attachments included in them will not be actioned on.

clean

Whether to clean messages. If this is disabled, the filter will not remove the offending messages that caused the filter to be triggered.

trigger

The number of messages with attachments that need to be sent to count as having violated the constraints.

time

The amount of time in which the trigger value needs to be reached to count as having violated the constraints.

EG: If trigger equals 10 and time equals 30, that means 10 attachments need to be sent within 30 seconds to cause the bot to take action.

Emoji

SettingDescription

enabled

Toggles the emoji filter. If this is disabled, messages with custom emoji included in them will not be actioned on.

clean

Whether to clean messages. If this is disabled, the filter will not remove the offending messages that caused the filter to be triggered.

trigger

The number of messages with emoji that need to be sent to count as having violated the constraints.

time

The amount of time in which the trigger value needs to be reached to count as having violated the constraints.

EG: If trigger equals 10 and time equals 30, that means 10 emoji need to be sent within 30 seconds to cause the bot to take action.

Max Messages

SettingDescription

enabled

Toggles the max messages filter. If this is disabled, the total number of messages sent in a channel will not be actioned on.

clean

Whether to clean messages. If this is disabled, the filter will not remove the offending messages that caused the filter to be triggered.

trigger

The number of total messages that need to be sent to count as having violated the constraints.

time

The amount of time in which the trigger value needs to be reached to count as having violated the constraints.

EG: If trigger equals 20 and time equals 30, that means 20 messages need to be sent within 30 seconds to cause the bot to take action.

Mentions

SettingDescription

enabled

Toggles the mentions filter. If this is disabled, messages with mentions included in them (user or role) will not be actioned on.

clean

Whether to clean messages. If this is disabled, the filter will not remove the offending messages that caused the filter to be triggered.

trigger

The number of messages with mentions that need to be sent to count as having violated the constraints.

time

The amount of time in which the trigger value needs to be reached to count as having violated the constraints.

EG: If trigger equals 20 and time equals 30, that means 20 mentions need to be sent within 30 seconds to cause the bot to take action.

Newlines

SettingDescription

enabled

Toggles the newlines filter. If this is disabled, messages with new lines included in them will not be actioned on.

clean

Whether to clean messages. If this is disabled, the filter will not remove the offending messages that caused the filter to be triggered.

trigger

The number of messages with new lines that need to be sent to count as having violated the constraints.

time

The amount of time in which the trigger value needs to be reached to count as having violated the constraints.

EG: If trigger equals 30 and time equals 30, that means 30 new lines need to be sent within 30 seconds to cause the bot to take action.

Last updated