Discord Bot CoreFeatured

Discord Bot Core

2025OngoingBots & Automation

Overview

discord-bot-core is my personal framework crate for building Discord bots in Rust. Built on the twilight stack (gateway, http, cache, standby) with Tokio, it exposes a BotBuilder and a GlobalState with type-keyed dependency injection, plus a unified dispatcher for slash commands, gateway events, message components, and cron-scheduled tasks. It bundles opt-in feature modules whose database migrations are gated by registration rather than config flags, layered TOML + env configuration, Fluent-based internationalization, an in-memory and Redis cache layer, metrics and audit logging, permission and rate-limit helpers, SSH tunneling, and integrations for Google Sheets/Calendar and Microsoft/Minecraft MSA auth. Persistence spans SeaORM (Postgres/MySQL), MongoDB, and Redis. Each bot I build depends on it by path and is wired into its workspace as a git submodule.

RusttwilightTokioSeaORMFramework

My Role

Author

Key Features

BotBuilder + GlobalState with type-keyed DI
Unified slash command, event, component, and cron-schedule dispatch
Opt-in feature modules with registration-gated migrations
Persistence across SeaORM (Postgres/MySQL), MongoDB, and Redis
In-memory + Redis caching, metrics, and audit logging
Fluent i18n, layered TOML + env config
Permission and rate-limit helpers, SSH tunneling
Google Sheets/Calendar and Microsoft/Minecraft MSA auth integrations

Challenges Solved

Designing a reusable framework crate with type-keyed dependency injection via GlobalState
Building a unified command/event/component/schedule dispatcher shared across bots
Gating optional-feature database migrations by FeatureModule registration
Managing per-bot git submodules with automated two-way GitHub org sync

Tech Stack

Backend

RusttwilightTokioSeaORM

Database

PostgreSQLMongoDBRedis

Tools & Services

Fluent i18ncronDocker Composemusl