Skip to content
Slash commandMessages & reporting

purge

Bulk-delete messages with filters, cross-channel targeting, and a safe test-run mode.

Usage

/purge [max_age] [max_messages] [from_author] [search_pattern] [between_msg_ids] [bot_or_user] [has_embed] [has_attachment] [in_channel] [all_channels] [test_run] [mode]

<angle brackets> are required; [square brackets] are optional.

Required user permissions
modules.messages.purge.deletemodules.messages.purge.dry.delete
Required bot permissions
View ChannelsRead Message HistoryManage Messages

The dry-run node is used only when test_run is true; deletion uses the delete node.

Arguments

max_age string
Optional

Only messages newer than a duration such as 1w2h.

max_messages integer
Optional

Maximum messages to delete, up to 1,000.

from_author user
Optional

Only messages from this user.

search_pattern string
Optional

Space-separated exact or wildcard content patterns.

between_msg_ids string
Optional

Two message IDs defining a range.

bot_or_user choice
Optional

Only bot messages or only user messages.

Choices:UsersBots
has_embed choice
Optional

Require or exclude embeds.

Choices:Has embedsDoes not have embeds
has_attachment choice
Optional

Require or exclude attachments.

Choices:Has attachmentsDoes not have attachments
in_channel channel
Optional

Target a different channel.

all_channels boolean
Optional

Search every channel in the server.

Default: false

test_run boolean
Optional

Preview matches without deleting messages.

Default: false

mode string
Optional

Reliable finds everything; Fast may miss messages.

Default: Reliable

Choices:ReliableFast

Examples

Preview up to 100 recent messages from one user.

/purge from_author:@Member max_messages:100 test_run:true

Delete week-old matching messages across the server.

/purge max_age:1w search_pattern:"*spam*" all_channels:true