/purge
The /purge
command allows you to mass-delete messages from a channel. You can specify filters to delete messages from specific users, with specific content, sent within a specific time range, and more.
At least one argument must be specified for this command to work. This can be any argument and any value can be specified, even default values.
Parameters
- mode
default: Delete message
what to do on the selected messages
Valid values are:
Delete message
Clear reactions
Count
- author-action
default: None
what to do on the authors of the selected messages
Valid values are:
Kick — You must have Kick Members.
Ban — You must have Ban Members.
Roleban — You must have Ban Members and Kick Members.
Kick from voice — You must have Move Members.
Timeout (5 minutes) — You must have Time out members.
Timeout (1 hour) — You must have Time out members.
- from
default: None
filter by author
- including
default: None
filter by substring
- regex
default: None
filter by regular expression
- case-sensitivity
default: Sensitive
whether
including
andregex
works case sensitively or notValid values are Sensitive and Insensitive.
- preset
default: None
filter by preset
This can be used to form more complex selections that are not possible with the other parameters.
Valid values are:
with attachments or embedded content
without attachments or embedded content
with attachments marked as spoiler
with attachments that are not marked as spoiler
containing custom Emoji
containing URLs
sent by members with no roles
sent by members who are not members of this server anymore
sent by members who joined less than 60 minutes ago
that contain characters outside of ASCII
that contain characters outside of latin-1 — Permits characters like
é
andñ
.that are not pinned
that have reactions
that don't have reactions
rich-presence related
sent by bots
sent from a webhook
sent from a Discord system account
- attachment-type
default: None
filter by attachment mimetype
Valid values are:
application/*
audio/*
image/*
image/*
message/*
multipart/*
text/*
video/*
font/*
example/*
model/*
chemical/*
- logical-connective
default: All
how to combine filters
Valid values are:
must meet all criteria — AND gate
must meet any criteria — OR gate
- silent
default: No
whether to avoid sending a public message
Valid values are Yes and No.
- after
default: None
filter out messages sent before this
Accepts links to messages, message IDs, or any value acceptable for human time parsing. UTC will be assumed if no timezone is provided.
- before
default: None
filter out messages sent after this
Accepts links to messages, message IDs, or any value acceptable for human time parsing. UTC will be assumed if no timezone is provided.
- limit
default: 2,000
maximum number of messages to scan
Valid values are integers in the range 1 to 2,000.