Clear messages
Created by Maxime_48 · 35 minutes ago · Views: 1
Delete one message, or the last messages of a member, a role or a channel, from a command or from a right click.
Two doors do the same thing: the /clear command and the Delete Message entry of the message menu (staff, deletes for good).
🧹 Delete messages: /clear
- Type
/clear. - Choose what to delete (see the options below), then press Enter.
- The bot first counts what it would delete, without deleting anything.
- From the number set in the panel, it shows the count and two buttons: Confirm delete and Cancel. Below that number it simply goes ahead.
- The bot answers with the number of messages deleted.
Everything the bot says is private: only you see it.
| Option | What it does |
|---|---|
message |
One message: paste its link or its ID. A link works from any channel, as long as it comes from your own server. |
count |
The last N messages of the channel, from 1 up to the maximum set in the panel (100 at most). |
user |
With count: only that member's messages among the last ones. |
role |
With count: only the messages of members wearing that role, including members the bot had not seen yet. |
channel |
The channel to clear. Without it: the channel the link points to, or the one you typed the command in. |
reason |
Up to 512 characters. It is written in your moderation log, not sent to the member. |
message takes no other target. user and role cannot be combined. Messages older than 14 days are deleted one by one, so it takes longer.
🖱️ Delete one message with a right click
Right-click (or long-press) a message, Apps, then Delete Message. If your server asks for a reason, a window opens to type it. Then the message is gone.
🛡️ What is never touched
- The bot's own messages, always.
- Messages of members with a protected role, chosen in the Moderation settings. Roles placed above the protection can still delete them.
- A message whose author cannot be read is treated as protected.
Protected messages are left out before anything is deleted, and counted as "skipped" in the preview and in the report.
⚠️ Confirmation, reason and limits
- Confirmation: the bot asks for a second click from the number you set in Confirm above this many messages (10 by default). One single message is never asked about. Set 0 to ask for every batch. Roles can be exempt from it. You have 60 seconds; after that nothing is deleted.
- Reason: the Moderation page can require a reason every time. A command without one is refused; the menu asks for it in a window. Chosen roles can be exempt.
- Never more than shown: the deletion stops at the count the preview gave, so a confirmation never clears more than it announced.
- One clear at a time per server.
- Deleted messages cannot be recovered. The bot keeps none of their content.
🔑 Who can use it
- The Moderation feature is enabled on the server.
- If the server named moderator roles in the panel, only members with one of these roles can delete through the bot, even a member holding Discord's Manage Messages.
- If the server named none, Discord's Manage Messages decides, in the channel concerned.
- The bot needs View Channel, Read Message History and Manage Messages in that channel.
Neither command is hidden by Discord any more: a moderator who does not hold Manage Messages still sees them, and the bot decides.
📋 What is logged
With a moderation log channel, two entries appear: one before the first deletion (who, where, what, why) and one at the end (how many deleted, how many skipped). They hold counts, never the text of a message.
🔧 When something goes wrong
🚨 "You do not have a role that is allowed to use moderation commands on this server"
The server named moderator roles and you do not wear one. Ask an admin to add yours in the Moderation settings.
🚨 "This server named no moderator roles, so only a member holding Discord's own Manage Messages can clear messages here"
Ask the owner to name moderator roles in the panel, or to give you Manage Messages in that channel.
🚨 "This server requires a reason"
Run /clear again with reason:, or use the Delete Message menu.
🚨 "That message link comes from another server"
The bot only clears the server you are on.
🚨 "I cannot read or manage messages in that channel"
Give the bot View Channel, Read Message History and Manage Messages there.
🚨 "A clear is already running on this server"
Wait for the report of the other one, then try again.
🚨 Fewer messages than asked were deleted
The report says why: messages of protected roles and of the bot are skipped, and the channel may hold fewer messages than requested.