Docs

Auto Purge

Automatically delete messages in channels.

Configure Auto Purge in the dashboard →

Overview#

Auto purge clears a channel on a schedule. Pick the channel, how often, what time of day, and how many messages each run should delete. Nobody has to remember to sweep it.

Each schedule is independent, so a bot commands channel can clear nightly while a memes channel clears weekly. Every run is written to the log channel.

A schedule can either delete messages or nuke the channel. Nuking deletes the channel outright and immediately recreates it with the same name, position, category, topic, slowmode and permission overwrites. It is the only way to clear a channel completely, because Discord will not bulk delete messages older than 14 days.

Setup#

  1. Open the dashboard and go to Moderation > Auto Purge, then turn the module on.

  2. Press Add Schedule.

  3. Pick the Channel, an Action of delete messages or nuke channel, a Frequency of daily or weekly, and the Time in UTC.

  4. For the delete action, set Messages to delete (1-1000) for each run. Nuking always clears everything.

  5. Set a Log Channel so you can see the runs happen, then save.

Settings#

SettingTypeDefaultWhat it does
Enable Auto PurgeToggleOffThe master switch. No schedule runs while it is off.
ChannelChannel-The channel this schedule clears. One schedule per channel.
ActionChoiceDelete messagesDelete messages removes the last N messages. Nuke channel deletes the channel and recreates it identically, clearing it completely.
FrequencyChoiceDailyDaily or weekly.
Time (HH:MM, UTC)Text00:00When the run happens. Always UTC, not your local time.
Messages to delete (1-1000)Number100How many messages each run removes, newest first.
Reminder in the channelChoiceNo reminderKeep at the bottom reposts the reminder after people chat. Repost on a timer posts it every 1, 2, 3, 6, 12 or 24 hours. Either way the previous reminder is deleted first.
Reminder messageTextThis channel is cleared {time}.{time} becomes the time left, {date} the exact date, {channel} the channel. Up to 500 characters.
Message after each clearTextNonePosted as the first message once the channel is cleared. Same placeholders, up to 2000 characters.
Log ChannelChannelNoneWhere purge runs are recorded. Leave empty for no logging.

Commands#

  • .autopurge help Add, list and remove schedules from chat. Manage Messages
  • .autopurge nuke <#channel> <daily|weekly> <HH:MM> Schedule a nuke instead of a message delete. Manage Messages
  • .autopurge reminder <#channel> <off|sticky|2h> [message] Keep a "cleared in X" reminder in the channel, at the bottom or on a timer. Manage Messages
  • .autopurge aftermessage <#channel> <message|none> Set the message posted right after each clear. Manage Messages
  • /purge all <count> Clear a channel now, by hand, instead of waiting for the schedule. Manage Messages

Permissions#

PermissionWhy Iris needs it
Manage MessagesDeletes the messages. Nothing runs without it.
Manage ChannelsOnly for nuke schedules: deletes and recreates the channel.
Read Message HistoryFinds the messages to delete.
View ChannelsSees the scheduled channel and the log channel.
Send MessagesWrites the log entry, the reminder and the after-clear message.
Embed LinksThe reminder and after-clear message are sent as embeds.

What it looks like#

I
Iris APP Today at 11:22 PM
Auto-Purge Executed

Automatically purged messages in #bot-commands

Messages Deleted

100

Channel

#bot-commands

Schedule

Frequency: Daily
Time: 04:00 UTC

A completed run in the log channel.

Tips and gotchas#

Nothing was deleted.

Check the module is on, that Iris holds Manage Messages in that channel, and that the messages are under 14 days old.

Can one channel have two schedules?

No. It is one schedule per channel. Raise the count or the frequency instead.

What is the difference between delete and nuke?

Delete removes up to 1000 recent messages and leaves the channel alone. Nuke deletes the channel and rebuilds it, so it always ends up completely empty, but the channel gets a new ID.

Are pinned messages deleted?

Yes. A run clears everything it can reach, pins included. Keep anything worth keeping in a channel that is not on a schedule.