How adamseidman/spotify-guesser-bot works
Songs Chain Discord Bot lets server members build song-title chains by posting prefixed guesses; the bot checks each guess against the current game, validates it against Spotify, and updates the chain or ends the round. Discord interactions also expose server setup, challenges, shuffle, history, leaderboards, statistics, and help. Game state and persistent histories, rules, and results are handled through the database layer. The graph follows the sampled entry point, game, command, Spotify, and database code; some command implementations are represented by their paths without asserting unsampled internal wiring.
Main entry points: commands.js Command router · db.js Persistent game data · set.js Server settings · game.js Game state and rules
Components 16
Discord runtime
- Bot client
client/client.js - Command router
base/commands.js - Request queue
base/reqHandling.js
Chain gameplay
- Game state and rules
base/game.js - Track search
base/spotify.js
Server features
- Server settings
base/slash-commands/set.js - Song challenges
base/slash-commands/challenge.js - Chain shuffle
base/slash-commands/shuffle.js - Chain history
base/slash-commands/history.js - Leaderboards
base/slash-commands/leaderboard.js - Game statistics
base/slash-commands/stats.js - Help and guidance
base/slash-commands/help.js
Data services
- Persistent game data
base/db.js
Other components
- Server member
- Discord platform
- Spotify API
Connections 28
- Server member → Discord platform: sends events
- Discord platform → Bot client: delivers events
- Bot client → Command router: routes interactions
- Bot client → Request queue: enqueues messages
- Request queue → Command router: dispatches messages
- Command router → Persistent game data: reads server rules
- Command router → Game state and rules: submits guesses
- Game state and rules → Track search: requests tracks
- Track search → Spotify API: searches tracks
- Game state and rules → Persistent game data: loads and saves state
- Command router → Server settings: dispatches settings
- Command router → Song challenges: dispatches challenges
- Command router → Chain shuffle: dispatches shuffle
- Command router → Chain history: dispatches history
- Command router → Leaderboards: dispatches leaderboard
- Command router → Game statistics: dispatches statistics
- Command router → Help and guidance: dispatches help
- Server settings → Game state and rules: changes channel
- Server settings → Persistent game data: updates rules
- Chain history → Persistent game data: reads histories
- Leaderboards → Persistent game data: reads scores
- Game statistics → Persistent game data: reads results
- Command router → Discord platform: sends game responses
- Server settings → Discord platform: replies to interactions
- Chain history → Discord platform: displays history
- Leaderboards → Discord platform: displays rankings
- Game statistics → Discord platform: displays statistics
- Help and guidance → Discord platform: displays guidance