How ckagias/discord-bot works
This repository is a Discord community bot with a guild-management dashboard. Members interact through Discord commands, events, and components; administrators can also configure guild features in the dashboard. The bot covers moderation, community tools, leveling, economy, games, and music, with MongoDB-backed state and Lavalink playback. The map emphasizes documented product capabilities and sampled startup/event wiring; unsampled command and dashboard action internals are represented only at their supported directory paths, without speculative call edges.
Main entry points: index.ts Bot startup · lavalinkHandler.ts Lavalink integration · events Gateway events · models Bot data models
Components 23
Bot runtime
- Bot startup
src/index.ts - Event registration
handlers/eventHandler.ts - Gateway events
events - Command registration
handlers/slashCommandHandler.ts - Interactive components
handlers/componentHandler.ts
Guild features
- Slash commands
slashCommands - Moderation and safety
slashCommands/moderation - Community tools
slashCommands/utility - XP and leveling
slashCommands/leveling - Economy and games
slashCommands/economy - Music controls
slashCommands/music
Persistent state
- Music recovery
utils/musicPersistence.ts - Bot data models
models - Dashboard data models
dashboard/lib/models
External services
- Discord platform
- Lavalink integration
handlers/lavalinkHandler.ts - MongoDB
- Discord OAuth API
Admin dashboard
- Dashboard authentication
dashboard/app/api/auth - Guild settings pages
dashboard/app/dashboard/[guildId] - Settings actions
dashboard/app/dashboard/[guildId]
Other components
- Discord members
- Guild administrator
Connections 19
- Discord members → Discord platform: uses
- Discord platform → Gateway events: sends events
- Bot startup → MongoDB: connects
- Bot startup → Event registration: registers events
- Bot startup → Command registration: registers commands
- Bot startup → Interactive components: registers components
- Event registration → Gateway events: loads listeners
- Bot startup → Lavalink integration: initializes
- Lavalink integration → Music recovery: persists playback
- Lavalink integration → Discord platform: sends playback updates
- Guild administrator → Dashboard authentication: signs in
- Dashboard authentication → Discord OAuth API: exchanges credentials
- Guild administrator → Guild settings pages: configures guild
- Guild settings pages → Settings actions: submits settings
- Slash commands → Bot data models: uses persistent state
- Gateway events → Bot data models: uses persistent state
- Settings actions → Dashboard data models: uses data models
- Bot data models → MongoDB: stores state
- Dashboard data models → MongoDB: stores dashboard data