# How to log deleted messages on Discord

> Keep a private log of deleted and edited messages, members joining and leaving, in a Discord channel only staff can see. Set up a logging bot from a template, no code.

Source: https://buildcord.dev/guides/discord-log-deleted-messages/
Updated: 2026-11-05
Publisher: Buildcord (https://buildcord.dev)

Discord doesn't show what a deleted message said. A logging bot does: it posts each deletion and edit, with the old text, to a channel only your staff can see, along with members joining and leaving. The logging template has those flows drawn. It reacts to server events, so it runs on Buildcord Boost, the $8-a-month plan.

## Steps

1. **Make a private log channel.** Create a channel such as `logs` and allow only your moderators and the bot to see it.
2. **Turn on two intents.** In the Discord Developer Portal, on your application's **Bot** page, turn on **Message Content Intent** to log what messages said and **Server Members Intent** to log joins and leaves.
3. **Start from the logging template.** Open the logging template in Buildcord. It makes a bot with an event flow for each of **Member joins**, **Member leaves**, **Message edited** and **Message deleted**.
4. **Point it at your channel.** In each flow's **Send to a channel** step, choose your log channel. Change the wording or the embed's color if you like.
5. **Deploy and test.** Paste your token and deploy. Send a message from a test account, edit it, then delete it. Both should appear in the log within a second or two.

## Good to know

- The bot can only say what a message said if it saw it sent, so messages from before it went live are logged without their text.
- An edit shows the text before as `{message.before}` and after as `{message.content}`.
- Add more events the same way: **Member banned**, **Member changes** for role and nickname changes, **Channel deleted**, **Role created** and **Invite created**.
- Skip bots with a **Member check**, so other bots' clean-up doesn't flood the log.

## Questions

### Can the log say who deleted a message?

No. Discord tells bots which message was deleted and who wrote it, but not who deleted it. Moderator deletions are in your server's audit log.

### Can I see messages that were deleted before I added the bot?

No. The bot only knows the text of messages it saw sent while it was running.

### Are logged messages stored anywhere else?

Not as the template comes. They are posted to your log channel. Add an Add row step if you want them in a collection too.

## Build it

Start from the [Server log template](https://buildcord.dev/templates/logging/), with every flow already drawn. Use the logging template: https://buildcord.dev/templates/logging/
