How adamseidman/dsf-discord-bot works
DSF-Discord-Bot is a Discord bot for generating daily “stupid facts,” with a web portal for managing bot data and settings. Its principal workflow starts with Discord events: commands and message handlers produce responses, while the fact scheduler supports daily channel posts and fact construction draws on domain data. The portal provides authenticated management and a fact-template generator. The graph also includes persistence and documented integration points; several routes and command implementations are unsampled, so uncertain call links are omitted.
Main entry points: server.js Web server · index.js Discord client · database.js Database layer · tables Domain tables
Components 24
Discord bot
- Discord client
discord/index.js - Command dispatch
discord/modules/commands.js - Bot commands
discord/commands - Message handlers
discord/modules/messages.js - Direct messages
discord/modules/directMessages.js - Voice features
discord/modules/voice.js
Fact domain
- Fact construction
fact/construction.js - Daily scheduler
fact/scheduler.js - Fact overrides
fact/override.js
Web portal
- Web server
web/server.js - Portal reads
web/get - Portal writes
web/post - Portal updates
web/put - Portal interface
web/public/js/portal.js - Template generator
web/public/generator/generator.js
Persistence
- Database layer
db/database.js - Domain tables
db/tables - Media buckets
db/media
Integrations
- Supabase
- External APIs
apis - Holiday service
apis/dateNager.js - Discord
Other components
- Discord user
- Portal user
Connections 19
- Discord user → Discord client: sends events
- Discord client → Command dispatch: dispatches commands
- Discord client → Message handlers: dispatches messages
- Discord client → Direct messages: dispatches DMs
- Command dispatch → Bot commands: dispatches command
- Discord client → Daily scheduler: schedules channels
- Fact construction → Domain tables: reads domain data
- Discord client → Discord: connects
- Portal user → Web server: requests portal
- Web server → Portal reads: dispatches GET
- Web server → Portal writes: dispatches POST
- Web server → Portal updates: dispatches PUT
- Portal interface → Web server: calls portal API
- Web server → Domain tables: authenticates users
- Web server → Database layer: stores sessions
- Database layer → Domain tables: initializes tables
- Database layer → Media buckets: initializes buckets
- Database layer → Supabase: reads and writes
- Holiday service → External APIs: fetches holidays