How codebymitch/titanbot works
TitanBot is a Discord server-management and community bot. A typical flow begins with a server member or moderator issuing a command or interacting with a component; Discord events and the interaction router dispatch to feature commands/services, which perform domain actions and persist guild-scoped state before responding in Discord. The README also documents broad feature families beyond the sampled implementation. The graph includes those feature branches, while edges are limited to relationships shown in excerpts, SOURCE INDEX references, or README statements; unsampled feature internals are represented at their existing directories.
Main entry points: commands Command catalog · app.js Bot application · interactionCreate.js Interaction routing · events Discord event handlers
Components 31
Bot Runtime
- Bot application
src/app.js - Discord event handlers
src/events - Command catalog
src/commands - Component interactions
src/interactions - Interaction routing
src/events/interactionCreate.js
Community Features
- Ticket workflows
src/services/ticket.js - Community applications
src/services/applicationService.js - Reaction roles
src/services/reactionRoleService.js - Join-to-create voice
src/services/joinToCreateService.js - Server counters
src/services/serverstatsService.js - Music playback
src/services/music/playerHandler.js - Utility and search
src/commands/Utility
Server Administration
- Moderation actions
src/commands/Moderation - Audit logging
src/services/loggingService.js - Member verification
src/services/verificationService.js - Guild configuration
src/services/config/guildConfig.js
Engagement Features
- Economy and shop
src/commands/Economy - XP and level roles
src/services/leveling/leveling.js - Giveaways
src/services/giveawayService.js - Birthday tracking
src/services/birthdayService.js - Welcome and auto roles
src/commands/Welcome
Shared Platform
- Database facade
src/utils/database.js - Guild config storage
src/utils/database/guildConfigStorage.js - PostgreSQL store
src/utils/postgresDatabase.js - Application configuration
src/config/application.js - Structured logging
src/utils/logger.js - Interaction responses
src/utils/interactionHelper.js - Error handling
src/utils/errorHandler.js
Other components
- Discord users
- Server moderators
- Discord API
Connections 32
- Discord users → Discord API: issues commands
- Server moderators → Discord API: manages server
- Discord API → Discord event handlers: sends events
- Bot application → Database facade: initializes database
src/app.js - Bot application → Command catalog: loads commands
src/app.js - Bot application → Server counters: updates counters
src/app.js - Discord event handlers → Interaction routing: routes interactions
- Interaction routing → Community applications: dispatches command
src/events/interactionCreate.js - Interaction routing → Reaction roles: dispatches interaction
src/events/interactionCreate.js - Interaction routing → Interaction responses: uses responses
src/events/interactionCreate.js - Interaction routing → Error handling: routes failures
src/events/interactionCreate.js - Command catalog → Moderation actions: provides commands
- Moderation actions → Audit logging: records actions
- Command catalog → Economy and shop: provides commands
- Command catalog → XP and level roles: provides commands
- Command catalog → Giveaways: provides commands
- Command catalog → Birthday tracking: provides commands
- Discord event handlers → Welcome and auto roles: handles member joins
- Command catalog → Ticket workflows: provides commands
- Command catalog → Community applications: dispatches application
src/commands/Community/apply.js - Command catalog → Reaction roles: configures roles
- Discord event handlers → Join-to-create voice: handles voice changes
- Bot application → Server counters: reads and refreshes
src/app.js - Command catalog → Music playback: provides controls
- Command catalog → Utility and search: provides tools
- Bot application → Application configuration: loads configuration
src/app.js - Guild configuration → Guild config storage: reads and writes
src/services/config/guildConfig.js - Guild config storage → Database facade: reads and writes
src/utils/database/guildConfigStorage.js - Database facade → PostgreSQL store: uses backend
src/utils/database.js - Bot application → Structured logging: logs startup
src/app.js - Interaction responses → Error handling: handles failures
src/utils/interactionHelper.js - Discord API → Music playback: provides voice playback