Skip to main content
← Blog

August 1, 2026 · The Minely team

How to build a message logging bot with AI (edits, deletes, mirrors)

Every moderation team eventually faces "I never said that" — and a logging bot is the receipt. Messages, edits, and deletions recorded with before-and-after content turn he-said-she-said into a thirty-second review. It is also the bot that quietly pays for itself every single week.

What a message logging bot actually is

A message logging bot records message edits and deletions into a log channel, showing the original content alongside what replaced it (or that it was deleted). Channel and category ignores keep staff rooms private, and attachment mirroring preserves images that would otherwise vanish.

How it works under the hood

The edit event carries before and after content; the delete event carries the last cached content. The bot formats both into the log with author, channel, timestamp, and a jump link. A local cache holds recent messages so deletions have content to show. Ignores are a config list of channels and categories that never log — staff channels stay staff-only. Attachments are re-uploaded to the log channel so they survive deletion.

The prompt that builds it

You do not have to write this yourself. A precise description is enough:

a logging bot that records message edits and deletes with before and after content in a log channel, channel ignores, and attachment mirroring

Name the commands, the permissions, and the exact messages players see. Precision here is what makes the first build land close.

Building it in the right order

  1. Wire the edit and delete events with the local cache.
  2. Format the log entries with links and context.
  3. Add channel and category ignores.
  4. Implement attachment mirroring.
  5. Add bulk-delete summaries and a lookup command.

The details that matter in production

In production, the first thing you learn is that the happy path is the easy half. The edges are where the work lives: restarts, protection interactions, full inventories, and players who treat every system like an exploit puzzle. Build for those from day one and the launch weekend is quiet instead of a fire drill.

Storage and cleanup deserve special attention. Write state as it changes rather than on shutdown, clear per-player state on quit and on world change, and make every admin-facing action leave an audit line. The first time something goes wrong, those records are the difference between a two-minute review and an evening of guessing.

Finally, test like a hostile user. Spam-click every GUI, rejoin mid-action, try the command with no permission and with every permission, and run it while the server is under load. The bugs that survive that pass are the ones worth shipping.

Tuning it after the first build

One log channel for everything gets noisy fast; split by category (general, staff-visible incidents, images). Cache a few hundred messages per channel — enough for deletes without unbounded memory.

Tips that save you a rebuild

  • Always ignore staff channels; the log bot leaking them is an instant trust-killer.
  • Include jump links; thirty seconds saved per incident is real time.
  • Log the bot's own actions as never-logged, or it logs itself forever.
  • Respect content policy: log metadata, keep message mirrors staff-only.

Questions people ask

How far back do deletes show?

As far as the cache reaches; older deletions show metadata only, which is usually enough.

Can I search the logs?

A lookup command by user or channel over the log storage answers most reviews in seconds.

What about thread messages?

Log them under their parent channel with a thread marker — same events.

Describe your version in the composer and see it built in minutes. Iterate with follow-up edits until it is exactly your server's flavor.