Purge command

Purge messages

.purge {number} - quick purge

.purge {filters} - advanced purge

.purge - interactive purge

{number}

The number of messages to purge, omitting this will trigger interactive setup mode


Filters

Supply parameters in the form of {filter_name:value etc.} to quickly apply advanced options to purging

You may provide filters all on the same line, or put each one on its own line; either works. You must include 'purge' in the filter list for purging to take place, in order to prevent accidental purges. Excluding 'purge' will simply initiate a pre-scan to display how many messages would be purged had the purge filter been in there.

Separate different filters with a space or newline, and you may use as many filters as necessary. If a parameter is multiple words, you must put quotation marks around the argument, like so: .purge "contains: hello world." All parameters are case insensitive.

For the Boolean (T/F) values, simply type them in to apply them (.purge links 12 will purge up to twelve messages containing links).

Some of these features are still in progress - the purge command needs to be renovated. Please use interactive setup (just .purge) until this message is removed


Filters

Filter Values Example and Description
{number} An integer .purge 10 links

Match the 10 most recent messages containing links

If {number} is omitted from the filters, it will default to 100
noLimit - .purge nolimit author:Spiderman

Match every single message sent by Spiderman
author User ID
Username#0000
Username
Nickname
NOT mention
.purge author:Mee6

Match messages by Mee6
humans

bots
- .purge 50 bots
.purge 50 humans

Match the last 50 messages by bots only
Match the last 50 messages by humans only
channel Channel name
Channel ID
.purge channel:bot-commands author:Dyno

Match messages by Dyno in the bot-commands channel

If channel is omitted from the filters, it will default to the current channel
contains
equals
startswith
endswith
Word or phrase .purge "{filter}:Bruno Mars"

contains: Match messages containing the phrase "Bruno Mars"
equals: Match messages with content exactly matching the phrase "Bruno Mars"
startswith: Match messages starting with the phrase "Bruno Mars"
endswith: Match messages ending with the phrase "Bruno Mars"
links - .purge links startswith:http://

Match messages containing hyperlink URLs starting with "http://"
invites - .purge invites author:Spammer#9876

Match messages by Spammer containing server invites
images - .purge images channel:memes

Match messages containing image attachments sent in #memes
videos - .purge 20 videos

Match 20 messages containing video attachments
audio - .purge audio bots

Match messages by bots only containing audio attachments
uncommon - .purge uncommon channel:general

Match messages containing uncommon attachments sent in #general

Uncommon attachments are anything not text/audio/video/image
attachments - .purge attachments equals

Match messages containing attachments with no text content
embeds - .purge embeds Auttaja

Match messages containing embeds sent by Auttaja
mentions - .purge mentions author:Raider#6969

Match messages containing user mentions sent by Raider
roleMentions - .purge rolementions humans

Match messages containing role mentions sent by humans
reaction if emoji provided, match that, else, any reaction .purge reaction:⭐ author:Hamilton#1804

Match messages containing the ⭐ reaction sent by Hamilton
presences - .purge presences channel:general

Match messages containing party invites sent in #general
beforeDate

afterDate
mm/dd/yyyy .purge afterdate: 6/20/2020 channel:spam

Match messages sent after June 20th, 2020 in #spam
beforeTime

afterTime
hhmm (24 hour)

hhmmAM or hhmmPM (12 hour)
.purge afterdate:yesterday beforetime:600pm images

Match messages sent today posted before 6:00 PM containing images
purge - .purge videos purge

Execute the purge by skipping the confirmation pre-scan message

By excluding this keyword, the bot will tell you how many messages will be purged, and you'll be able to confirm or redo the command

Advanced Examples and Scenarios

A user (named Ganon) is new to the server, and has been spam-posting random unrelated images in the #art channel

.purge author:Ganon channel:art images nolimit

This will match any message sent by Ganon in the art channel, containing an image


Your server was raided at 3:28PM by The Cat In The Hat#9999, Thing One#0001, and Thing Two#0002, who were already in the server and active before the raid. You need to purge their messages without deleting messages by others, or their messages before the raid.

Protip: You can stack the same filter!

.purge "author:The Cat In The Hat#9999" "author:Thing One#0001" "author:Thing Two#0001" afterTime:1527 nolimit

This will match any message sent by any of these three members that were sent since the start of the raid.

You can check out this page to learn more about how timezones work.


You would like to purge all the messages in #bot-commands containing either image or video files

For this, we'll use a logical {or} operator

.purge channel:bot-commands (image or video) NoLimit

By default, specifying an 'or' will link the two surrounding filters, meaning that the parentheses in this example aren't mandatory, but they improve organization.

Notes

The purpose of filters is to allow users to quickly purge messages if they know the syntax. If you aren't in a rush, you can get more fine-tuning in a much more intuitive method with the ineractive purge (it just takes longer due to the walkthrough process).