Cleaning

Understand all the subcommands available for purging messages from the chat.

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.

SajuukBot offers a number of bot commands for automating the removal of multiple messages from a channel. This allows for a clean archive to be generated of all purged messages without flooding a modlog in multiple single-message deletes, and also making it easier for moderators to deal with disruptive behaviour.

As with the base moderation commands described on the Moderation page, the cleaning module uses levels and allows exemptions to be applied.

Configuration

This section of configuration is a root key, which means it should not be indented and in line with the basic settings like levels, prefix and the like. Please see the full basic configuration for more details on how it should be formatted.

The suppress invoke option under the commands key is an optional setting which may be used to remove the invoking message from chat. This can be useful in certain situations in which you want the bot to perform its clean up, then remove all trace of the command being invoked within a channel. If the setting is false, or it is not included, by default the bot leaves your invoking command message in chat.

clean:
  enabled: false
  commands:
    suppress invoke: false
    user:
      enabled: false
      level: 50
    all:
      enabled: false
      level: 50
    bots:
      enabled: false
      level: 50
    channel:
      enabled: false
      level: 50
    channel user:
      enabled: false
      level: 50
    between:
      enabled: false
      level: 50
    until:
      enabled: false
      level: 50
    cancel:
      enabled: false
      level: 50

Commands

Due to space constraints, the required syntax of commands, and an example of how they work, are given provided after the list of commands and explanations.

Every command follows the exact same formatting:

  • A key called enabled determining if the command is enabled or not.

  • A key called level, determining the minimum level required to use the command

At the root of the clean key is an enabled key, which globally controls the commands assigned to this module. If the root key is false, then no command will operate, regardless of whether an individual command is enabled.

In all subcommands, with the exception of until and between, a limit is an optional argument. It is always the last argument in the command. If it isn't defined, the default is 25.

CommandDescription

!clean user

Cleans messages associated to a specific user from the invoking channel.

For a shorthand method of using this command, you can drop the user subcommand definition. See examples for how this works.

!clean all

Cleans messages from the invoking channel.

!clean bots

Cleans messages associated to bot users from the invoking channel. This may serve very little purpose unless its within a bot commands channel, as only messages from actual bot accounts will be targeted.

!clean channel

Cleans messages from a specified channel that isn't the invoking channel

!clean channel_user

Cleans messages associated to a specific user from a specified channel that isn't the invoking channel.

!clean between

Cleans messages within two message ranges, where the first ID references an old message and the second ID references a newer message.

!clean until

Cleans messages up to the defined message ID. This is equivalent to using !clean all but without needing to manually count the number of messages to be purged.

!clean cancel

Resets the state of cleaning in a channel, in case an error occurred that prevented the state being updated automatically.

This will not cease any running cleans that have already been started.

Syntax and Examples

Below are the syntax requirements of the above commands, along with an example to show how it works.

SyntaxExamples

!clean MEMBER/USER LIMIT !clean user MEMBER/USER LIMIT

!clean @SajuukBot#2980 50 !clean 535882175350964248 50 !clean user @SajuukBot#2980 50 !clean user 535882175350964248 50

!clean all LIMIT

!clean all 50

!clean bots LIMIT

!clean bots 50

!clean channel CHANNEL LIMIT

!clean channel #off-topic 50 !clean channel 408023460871405578 50

!clean channel_user CHANNEL MEMBER/USER LIMIT

!clean channel_user #off-topic @SajuukBot#2980 50 !clean channel_user #off-topic 161815653387468800 50 !clean channel_user 408023460871405578 @SajuukBot#2980 50 !clean channel_user 408023460871405578 161815653387468800 50

!clean between MESSAGE1 MESSAGE2

!clean between 776476152499404820 776476808651866122

!clean until MESSAGEID

!clean until 776476152499404820

Last updated