Someone posts something nasty, a mod screenshots too late, and the message is gone. You want a bot that would have kept it. That is possible, but it helps to know exactly how a deleted-message log works, because it explains every case where the log comes up empty.
How a bot logs deleted messages
When a message is deleted, Discord sends connected bots a Message Delete event. It contains three things: the message ID, the channel ID and the server ID. No text, no author, no attachments. Discord does not hand the content over after the fact.
So a logging bot works in two steps:
- It keeps a copy when the message arrives. Each new message comes in with its text, author and attachments, and the bot stores it, in memory or in a database.
- It looks the ID up when the delete arrives. If it finds the copy, it posts the author, channel and original text to your log channel.
To read message text at all, the bot needs the Message Content intent, a privileged permission its developer must switch on (and that Discord reviews for bots used by a lot of people). Without it, the bot can still tell you a message was deleted, but it has nothing to show you.
Why a deleted-message log has gaps
| Situation | What you see | Why |
|---|---|---|
| Message sent before the bot joined | Nothing, or "unknown message" | The bot never had a copy |
| Bot was offline when it was sent | Nothing | No copy was stored while it was down |
| Bot cannot view that channel | Nothing | It never received the message |
| Old message, short memory | "Message not cached" | Bots that keep copies in memory only hold recent messages |
| Bot has no Message Content intent | Author and channel, no text | It was never allowed to read the text |
| Message deleted in a DM | Nothing | Server bots do not see your members' DMs |
The audit log helps fill in who and where. When a message is deleted, Discord can record an entry with the channel and a count, kept for 45 days. It never shows the text. If you need edits logged too, the same rules apply: the bot needs the original to show a before and after. More on what the audit log covers is in the logging bot guide.
Set up delete logging
- Create a private
#message-logschannel. Only mods should be able to read it, because it will contain things people chose to delete. - Pick a logging bot that stores messages (check its privacy policy for how long), and invite it.
- Make sure it can view every channel you want covered. A bot cannot log a channel it cannot see.
- Turn on message delete and message edit logging and point both at
#message-logs. - Ignore channels that would flood it: bot commands, counting, spam.
- Test: send a message, wait a moment, delete it, and check the log. Then edit one.
Remember it only works from now on. Messages sent before the bot joined cannot be recovered by any bot.
Purges and bulk deletes
When a mod clears a batch of messages at once, Discord sends a bulk delete event with a list of IDs. Good logging bots turn that into one entry, often a text file with every message they had stored, rather than fifty separate posts. The audit log records the bulk delete with a count. If your bot posts each message separately, check its settings for a bulk-delete option before your next spam cleanup buries the log channel.
Rules for your log channel
- Say in your server rules that messages, edits and deletes are logged.
- Keep the log channel staff-only and review who has the role.
- Do not repost deleted messages in public channels to shame people. Use the log as evidence for moderation decisions.
- Decide how long you keep logs, and clear old ones.
Members sometimes ask whether Discord itself keeps deleted messages. That is a different question, covered in does Discord monitor servers.
Where VaultCord fits
What VaultCord keeps, and what it does not
VaultCord does not log deleted messages, so keep your logging bot. What VaultCord saves is the server itself. Channels, categories, roles, permissions and server settings. Paid plans add messages, emojis, stickers, bans and member role assignments. Backups are kept for life, not rotated out after a short period. If a nuke wipes channels and their history, a backup brings the structure back, and on Premium and Plus you get an email if the server is deleted. See what VaultCord monitors.
Open the VaultCord dashboard