messages

.delete

delete your own messages using text, attachment, channel, and history filters.

also known as.d
01

usage

command
.delete [options]

<required> · [optional] · replace placeholders before sending.

before you use it ↗
  • only your own messages are selected. system messages and the command message are excluded.
  • without --number, the selection has no message-count limit.
  • the normal command deletes its invocation before processing. verify mode keeps the invocation and applies no message deletions.
  • blacklisted source and target channels are blocked. blacklisted channels are skipped in scopes.
  • dm-scope deletion closes nonblacklisted open dms before scanning their messages. verify mode lists affected dms without this deletion routine.
  • a configured protected dm requires a yes/no response before deletion. the response window is thirty seconds.
  • flags can be reordered, but values must follow their flags. use straight quotes to group text containing spaces. text and filter values cannot begin with a dash.
02

options & arguments

-n, --number <count>

limit the number of matching messages to delete. without this option, all matching messages are selected. for a scope, the limit is shared across its channels.

-f, --filter <text>

match a case-sensitive substring in message text. multiword text continues until the next flag.

-e, --except

invert the combined text and attachment filters. cannot be combined with --message or --scope.

-m, --message <message_id>

use a message as an exclusive history boundary. select newer messages by default, or older messages with --reverse.

-c, --channel <channel_id/user_id>

target a text channel, thread, dm, group dm, or a user's dm by numeric id. ignored when --scope is used.

-r, --reverse

process messages from oldest to newest. also changes the message boundary to select older messages.

-a, --attachments <types>

match images, videos, files, links, or all. combine types with commas, such as images,links. image and video embeds are included, and links can come from message text, embeds, or attachments.

--skip-pinned

skip pinned messages.

-s, --scope <guilds|dms>

search all server text channels, or open and friend dms. a dm-scope deletion first closes nonblacklisted open dms.

-v, --verify

preview the selection. for a channel, send messages.txt. for a scope, list affected servers or dms.

-h, --help

show the command's built-in help.

03

try it like this

delete your ten newest matching messages in the current channel.

example
.delete -n 10

preview up to ten messages containing the exact substring old draft.

example
.delete -f old draft -n 10 -v

delete up to twenty matching image or link messages in a target channel or dm.

example
.delete -c 123456789012345678 -a images,links -n 20 --skip-pinned

list servers containing messages that match the filter.

example
.delete -s guilds -f old draft -v