The most advanced, high-performance, and memory-efficient Discord chat logging bot. Built for large-scale communities.
Languages: [Tiếng Việt] | [English]
- Complete Message Logging - Unlike most chat logging bots, MACB reliably detects edits and deletions on both newly sent and historical messages, even months after they were originally posted.
- Full Edit History - Preserves both original and updated message content, allowing moderators to review every revision.
- Offline Recovery - Automatically detects and reconstructs message edits and deletions that occurred while the bot was offline.
- Bulk Delete Detection - Differentiates between normal deletions, moderator purges, and bulk delete events using Discord Audit Logs.
- Rich Message Context - Stores replies, embeds, attachments, author information, and attachment MIME types for complete context.
- Permanent Media Preservation - Automatically downloads every attachments and re-upload a copy of them to the log channel, ensuring deleted media remains available even after Discord permanently removes CDN files.
- Optimized Media Rendering - Displays images and GIFs directly inside embeds while presenting videos as playable attachments for reliable desktop and mobile viewing.
- Fast Indexing - Synchronizes & Indexes existing server history at over 820 messages/sec, indexing 27,000+ messages in under 33 seconds.
- SQLite WAL Architecture - Uses dedicated read and write connections with WAL mode to support concurrent database operations efficiently.
- Delta-Based Startup Scan - Only scans channels that have changed since the previous shutdown, dramatically reducing startup time on large servers.
- Batch Database Writes - Buffers and commits messages in large batches to minimize disk I/O and maximize throughput.
- Memory Efficient - SQLite caches and scan buffers are bounded; real usage depends on parallel scans and attachment size (
MAX_PARALLEL_SCANS,MAX_PAYLOAD_BYTES_LIMIT). - Designed for Large Communities - Optimized to process large Discord servers with minimal CPU, memory, and database overhead.
- Slash Commands - Displays live uptime, database statistics, indexed message count, RAM usage, scan duration, and server information.
- Controlled Startup Logging - Offline edits and deletes are replayed in order, respecting the log queue and falling back to a dead-letter queue when Discord rate-limits (retained for up to 30 days or five replay attempts).
- Scheduled Activity Reports - Automatically sends hourly or daily moderation summaries to your configured log channel.
- Multi-language Support - Supports both English (
en) and Vietnamese (vi) through a single configuration option. - Health Watchdog - Continuously monitors background workers and automatically recovers stalled tasks for stable 24/7 operation.
- Modular Design - Separates core functionality into independent modules, enabling easier maintenance, customization, and component replacement.
- Production Ready - Built for long-term deployment with asynchronous workers, concurrent database access, and resilient startup synchronization.
Only took ~33s for 27,205 messages !

MACB only took ~3s to prepare the database and finish messages synching.

- Python 3.10+ (Ensure Python is added to your system PATH)
- A Discord Bot Token (created via the Discord Developer Portal)
- Discord Gateway Intents: Ensure Message Content Intent and Server Members Intent are toggled ON in the Discord Developer Portal under Bot -> Privileged Gateway Intents.
- Permissions: Ensure the Bot's highest role has the
Read Message History,View Audit Log, andView Channelspermissions for all monitored text channels.
git clone https://github.com/MeowIce/macb.git
cd macbInstall the required packages using pip:
pip install -r requirements.txt
pip install -r requirements-dev.txt # only needed to run the test suiteCopy .env.example to .env and fill in your settings:
cp .env.example .envKey environment variables in .env:
BOT_TOKEN: Your Discord Bot Token.TARGET_GUILD_ID: The ID of the Discord Guild (Server) you want to monitor.LOG_CHANNEL_ID: The ID of the text channel where log messages should be sent.BOT_LANG: Choose"en"for English or"vi"for Vietnamese.
TARGET_GUILD_ID and LOG_CHANNEL_ID are required; the bot stops at startup with a clear message if either is blank. Attachments are cached under CACHE_DIR (90 days, age-based eviction).
Example .env content:
BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN
TARGET_GUILD_ID=123456789012345678
LOG_CHANNEL_ID=987654321098765432
BOT_LANG=enNote
On MAX_PARALLEL_SCANS = 30 and MAX_PARALLEL_DOWNLOADS = 16: These settings are optimized for high-throughput systems. If your hosting environment (VPS/Home server) has limited CPU or network speed, reduce these values to 15 or 20 to prevent network congestion.
The rest can be left to default values unless specific tuning is needed.
Run the bot directly via the terminal:
python bot.pyNote
If MACB has been useful for your moderation workflow, consider giving the repository a star. Thank you ^^

Copyright (c) 2026 MeowIce. Permission is granted to use, modify, and distribute this software for non-commercial purposes only. Selling this software or any derivative works is prohibited without explicit written permission. Removing or altering author credits is prohibited.