How ryanjohnkennedy/pancakebot works
PancakeBot is a Discord slash-command bot. A user invokes a command in Discord; the bot routes the interaction, applies a per-server rolling rate limit, and executes the matching command. Ping replies directly, while the two Track of the Day commands fetch authenticated leaderboard data from the PancakeBot API and format it for Discord. On startup and when joining a server, the bot registers its commands with Discord. The excerpts show these runtime links; the API’s internal processing is outside this repository.
Main entry points: index.ts Event router · totd.ts Daily leaderboard · totd-month.ts Monthly leaderboard · deploy-commands.ts Command registration
Components 11
Bot runtime
- Event router
src/index.ts - Guild rate limiter
src/guild-rate-limiter.ts
Slash commands
- Command registry
src/commands/index.ts - Ping reply
src/commands/ping.ts - Daily leaderboard
src/commands/totd.ts - Monthly leaderboard
src/commands/totd-month.ts
Configuration and registration
- Runtime configuration
src/config.ts - Command registration
src/deploy-commands.ts
Other components
- Discord user
- Discord platform
- PancakeBot API
Connections 19
- Discord user → Discord platform: invokes command
README.md - Discord platform → Event router: delivers interaction
src/index.ts - Event router → Guild rate limiter: checks guild quota
src/index.ts - Event router → Command registry: looks up command
src/index.ts - Event router → Ping reply: executes selected
- Event router → Daily leaderboard: executes selected
- Event router → Monthly leaderboard: executes selected
- Ping reply → Discord platform: replies
src/commands/ping.ts - Daily leaderboard → PancakeBot API: fetches daily results
src/commands/totd.ts - Daily leaderboard → Discord platform: edits reply
src/commands/totd.ts - Monthly leaderboard → PancakeBot API: fetches monthly results
src/commands/totd-month.ts - Monthly leaderboard → Discord platform: edits reply
src/commands/totd-month.ts - Event router → Command registration: registers commands
src/index.ts - Command registration → Command registry: serializes commands
src/deploy-commands.ts - Command registration → Discord platform: updates guild commands
src/deploy-commands.ts - Event router → Runtime configuration: reads settings
src/index.ts - Command registration → Runtime configuration: reads credentials
src/deploy-commands.ts - Daily leaderboard → Runtime configuration: reads API settings
src/commands/totd.ts - Monthly leaderboard → Runtime configuration: reads API settings
src/commands/totd-month.ts