🎉 Launch offer: the next 5 servers get 30 days free. Claim a spot →
All topics & search

Guide/Protect your server/Clearing up after a punishment

Clearing up after a punishment — Discord Bot Guide

After a timeout, quarantine or ban, the offender's recent messages are removed automatically.

Quick answer

Tune the sweep

!security set cleanup.hours 2
!security set cleanup.actions timeout,quarantine

Ask the guide

Step by step

The mess outlives the punishment

Whatever got somebody timed out, quarantined or banned is usually still on screen afterwards, and a moderator deleting it by hand is the slowest part of handling an incident. Sweet removes the last hour of that member's messages automatically.

!security set cleanup.enabled off
!security set cleanup.hours 2
!security set cleanup.actions timeout,quarantine,ban
ActionHow it is clearedReach
BanDiscord deletes the messages itself as part of the banEvery channel, including ones the bot cannot see
TimeoutSweet sweeps recent channelsChannels where Sweet has Manage Messages and Read Message History
QuarantineSame sweepSame

Two limits are Discord's, not ours: bulk deletion cannot touch anything older than 14 days, and pinned messages are left alone. The sweep runs in the background at the lowest priority, so it never delays the punishment itself or a raid being contained — the action lands first and the tidying follows.

Every sweep is recorded as a security.cleanup event with the number of messages removed, so it shows up in !logs search like anything else.

Copy and try

Tune the sweep

!security set cleanup.hours 2
!security set cleanup.actions timeout,quarantine

Still stuck? Ask in the support server.

Clearing up after a punishment — Discord Bot Guide · Sweet