Skip to content
Guide6 min readLoggingUpdated 19 Nov 2026

How a Discord bot logs deleted messages

A Discord bot can only log a deleted message it saw first. Discord's delete event carries IDs, not text, so the bot has to keep its own copy as messages arrive. Here is how that works, why logs have gaps, and how to set it up properly.

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:

  1. 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.
  2. 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

Situations where a bot cannot log a deleted message
SituationWhat you seeWhy
Message sent before the bot joinedNothing, or "unknown message"The bot never had a copy
Bot was offline when it was sentNothingNo copy was stored while it was down
Bot cannot view that channelNothingIt 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 intentAuthor and channel, no textIt was never allowed to read the text
Message deleted in a DMNothingServer 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

  1. Create a private #message-logs channel. Only mods should be able to read it, because it will contain things people chose to delete.
  2. Pick a logging bot that stores messages (check its privacy policy for how long), and invite it.
  3. Make sure it can view every channel you want covered. A bot cannot log a channel it cannot see.
  4. Turn on message delete and message edit logging and point both at #message-logs.
  5. Ignore channels that would flood it: bot commands, counting, spam.
  6. 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

Questions people ask

Can a Discord bot see deleted messages?

Only if it saw them before they were deleted. When a message is deleted, Discord tells the bot the message ID, channel and server, not the text. A logging bot keeps a copy of messages as they arrive and looks the ID up when the delete comes in.

Can I see deleted messages on Discord without a bot?

Not the content. The audit log can show that messages were deleted in a channel and how many, for 45 days. The text itself is gone from Discord's interface once it is deleted.

Why did my logging bot miss a deleted message?

Usually because the message was sent before the bot joined, while it was offline, before it was given access to that channel, or long enough ago that the bot no longer kept a copy. It can also happen if the bot lacks the Message Content intent.

Does a bot logging messages break Discord's rules?

Logging in your own server is common and allowed, but the bot has to follow Discord's developer policies on handling message data. Tell members in your rules that messages are logged and who can read the logs.