How kevinurreta/discord-bot works
MultifuncionalBot is a self-hosted Discord bot whose user-facing workflow is Discord commands and events handled by the bot client, with responses and server settings supported by translation and persistence. Its main product branches are information, moderation, music, and server configuration; music uses a separate Lavalink integration. The graph also shows database repositories and ORM models as an internal persistence layer. Some command and event modules were not sampled, so those subsystems are represented by their existing directories; links are limited to relationships supported by the README or source index.
Main entry points: client.py Discord client · guild_settings.py Settings repository · info Information commands · settings Server settings
Components 28
Bot runtime
- Application entry
main.py - Discord client
src/app/client.py - Module loader
src/core/loader.py - Settings
src/core/config.py - Logging
src/core/logging.py
Bot features
- Discord events
src/app/events - Data sync task
src/app/tasks/sync_data.py - Information commands
src/app/commands/info - Moderation commands
src/app/commands/moderation - Music commands
src/app/commands/music - Server settings
src/app/commands/settings - Translation service
src/i18n/translate.py - Localized embeds
src/helpers/embed.py - Permission checks
src/helpers/permissions.py
Persistence
- Database connection
src/infrastructure/database/connection.py - CRUD repository
src/infrastructure/database/repositories/base.py - Guild repository
src/infrastructure/database/repositories/guild.py - Settings repository
src/infrastructure/database/repositories/guild_settings.py - Member repository
src/infrastructure/database/repositories/member.py - User repository
src/infrastructure/database/repositories/user.py - Guild model
src/infrastructure/database/models/guild.py - Guild settings model
src/infrastructure/database/models/guild_settings.py - Member model
src/infrastructure/database/models/member.py - User model
src/infrastructure/database/models/user.py
External services
- PostgreSQL
- Lavalink audio
- Lavalink connector
src/infrastructure/lavalink/connection.py
Other components
- Discord users
Connections 40
- Discord users → Discord client: uses bot
- Application entry → Discord client: starts
main.py - Application entry → Settings: loads settings
main.py - Discord client → Settings: uses settings
src/app/client.py - Discord client → Module loader: loads modules
src/app/client.py - Discord client → Database connection: creates tables
src/app/client.py - Discord client → Lavalink connector: connects
src/app/client.py - Discord client → Discord events: dispatches events
- Discord users → Information commands: requests information
- Discord users → Moderation commands: requests moderation
- Discord users → Music commands: requests music
- Discord users → Server settings: changes settings
- Information commands → Guild repository: reads guild data
src/app/commands/info/guild_stats.py - Information commands → Settings repository: reads preferences
src/app/commands/info/guild_stats.py - Information commands → Member repository: reads members
src/app/commands/info/guild_stats.py - Information commands → User repository: reads users
src/app/commands/info/guild_stats.py - Moderation commands → Permission checks: checks access
src/app/commands/moderation/purge.py - Moderation commands → Localized embeds: formats response
src/app/commands/moderation/purge.py - Music commands → Localized embeds: formats response
src/app/commands/music/play.py - Music commands → Lavalink audio: controls playback
- Server settings → Permission checks: checks access
src/app/commands/settings/language.py - Server settings → Localized embeds: formats response
src/app/commands/settings/language.py - Server settings → Translation service: translates responses
src/app/commands/settings/language.py - Server settings → Settings repository: updates language
src/app/commands/settings/language.py - Localized embeds → Translation service: requests translations
src/helpers/embed.py - Translation service → Settings repository: reads language
src/i18n/translate.py - Data sync task → Guild repository: syncs guilds
src/app/tasks/sync_data.py - Data sync task → Settings repository: syncs settings
src/app/tasks/sync_data.py - Data sync task → Member repository: syncs members
src/app/tasks/sync_data.py - Data sync task → User repository: syncs users
src/app/tasks/sync_data.py - Guild repository → CRUD repository: extends CRUD
src/infrastructure/database/repositories/guild.py - Settings repository → CRUD repository: extends CRUD
src/infrastructure/database/repositories/guild_settings.py - Member repository → CRUD repository: extends CRUD
src/infrastructure/database/repositories/base.py - User repository → CRUD repository: extends CRUD
src/infrastructure/database/repositories/base.py - Guild repository → Guild model: persists
src/infrastructure/database/repositories/guild.py - Settings repository → Guild settings model: persists
src/infrastructure/database/repositories/guild_settings.py - Member repository → Member model: persists
src/infrastructure/database/repositories/member.py - User repository → User model: persists
src/infrastructure/database/repositories/user.py - Database connection → PostgreSQL: connects to
src/infrastructure/database/connection.py - Lavalink connector → Lavalink audio: connects to