Clearing messages
Bulk delete recent messages with /clear, filtered by user, bots, embeds, links or images.
Usage
/clear amount:25 removes the last 25 messages in the current channel. Add filters to delete only some of them: the bot looks at the last N messages and deletes the ones that match.
- amount
- Required, 1 to 100. How many recent messages to look at.
- user
- Only messages from this member.
- bots
- Only messages sent by bots.
- embeds
- Only messages that contain an embed.
- link
- Only messages containing a link.
- images
- Only messages with an image attachment.
The 14-day limit
Discord's bulk delete API refuses messages older than 14 days. The bot filters those out silently rather than failing the whole command, so "No messages found matching your filters" can mean the matching messages are simply too old. Older messages have to be deleted one by one in Discord.
Permissions
The command is admin-only on the bot side, and the bot itself needs Manage Messages in the channel. If the bot role is denied that permission by a channel override, /clear fails even for admins.
Deleted messages are gone; there is no undo. Use the user filter to avoid taking out staff replies with the spam.