Discord.py oriented platform for general server logging
Chromium is a robust, production-ready Discord bot designed for comprehensive server logging and moderation auditing. Built with discord.py 2.0+, it emphasizes modularity, security, and scalability. Features include per-guild isolated logging configurations, intelligent log rotation, suspicious activity heuristics, and seamless Google Drive integration for data redundancy.
- About
- Features
- Screenshots
- Installation
- Usage
- Configuration
- Project Structure
- Roadmap
- Contributing
- License
- Contact
Chromium exists to fill the gap for a reliable, self-hosted logging solution that respects data privacy and server specific needs. Unlike generic bots, Chromium offers granular control over what is logged, ensuring that server administrators have the exact data they need for auditing without the noise.
Core Goals:
- Reliability: Ensure no critical event is missed.
- Privacy: Keep logs isolated per guild and rotated to minimize data hoarding.
- Scalability: Built on
AutoShardedBotto handle growth effortlessly.
- Modular Architecture: Enable or disable specific logging modules (Message, Voice, Member, Role, Channel, etc.) on a per-guild basis.
- Audit Log Lookups: Automatically correlates events with audit log entries for richer context.
- Database Rotation: Automatically prunes logs exceeding the 50-entry limit per guild (ON EXPORT) to maintain database performance and reduce storage footprint.
- Suspicious Activity Heuristics: Algorithms to detect and flag potential raids, nuke attempts, or anomalous user behavior (e.g., mass deletions, rapid role changes).
- Per-Guild Isolation: Strict data boundaries ensure configuration and logs never leak between servers.
- Google Drive Backups: Optional integration to automatically upload database backups and log exports to Google Drive.
- Docker Ready: tailored
Dockerfilefor easy containerized deployment. - Sharding Support: Native support for Discord sharding.
- Python 3.11 or higher
- A Discord Bot Token (with Message Content, Server Members, and Presence Intents enabled)
- (Optional) Google Cloud Service Account credentials for Drive integration
-
Clone the repository
git clone https://github.com/ThatOneFBIAgent/Chromium.git cd Chromium -
Install dependencies
pip install -r requirements.txt
-
Configure Environment Create a
.envfile in the root directory (see Configuration below). -
Run the bot
python bot.py
-
Build the image
docker build -t chromium-bot . -
Run the container
docker run -d \ --name chromium \ --env-file .env \ -v $(pwd)/data:/app/data \ --restart unless-stopped \ chromium-bot
Chromium uses Slash Commands for all interactions.
/setup- Initialize the bot for your server./log <module> <channel>- Configure a logging module to a specific channel./export- Export logs to a JSON file for safekeeping.
To set up message logging:
- Run
/setupto initialize the database for your guild. - Create a channel
#server-logs. - Run
/log message #server-logs.
Environment variables are managed via a .env file. Copy .env.example as a template.
| Variable | Description | Required |
|---|---|---|
DISCORD_TOKEN |
Your Discord Bot Token. | Yes |
BETA_TOKEN |
Alternate token for dev/beta instances. | No |
DRIVE_CREDS_B64 |
Base64 encoded Google Service Account JSON. | No |
DRIVE_FOLDER_ID |
ID of the Google Drive folder for backups. | No |
SHARD_COUNT |
Force specific shard count (Default: Auto). | No |
Chromium/
├── bot.py # Application entry point
├── config.py # Configuration loader
├── Dockerfile # Container definition
├── requirements.txt # Python dependencies
├── commands/ # Slash command cog implementations
├── database/ # SQLite database wrapper & migration logic
├── logging_modules/ # Individual event logging logic (Modular)
├── services/ # Background services (Backup, cleanup)
└── utils/ # Helper utilities (Drive, Embeds, RateLimit)- Web Dashboard: A frontend for easier log viewing and configuration.
- Advanced Analytics: Visual graphs for server activity.
- Multi-Language Support: Localization for response messages.
- Plugin System: API for community-created logging modules.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Please ensure your code follows the existing style conventions (PEP 8) and passes any included tests.
To run the test suite (if applicable):
pytestDistributed under the AGPLv3 License. See LICENSE for more information.
- Issues: GitHub Issues
- Discord:
_izacarlos

