Go back

Spotify-Helper

Spotify Helper is a Discord bot that seamlessly integrates Spotify playback controls directly into Discord servers, allowing users to play songs and manage their queue without leaving the chat interface.

I built the entire system: a Discord bot with slash commands, OAuth 2.0 authentication flow for Spotify, token management with automatic refresh, and a web interface for secure account linking. The bot extracts Spotify track IDs from shared links and controls playback through Spotify’s Web API.

How it works (link → playback)

  1. Account linking: Users run /setup to get a secure OAuth link that connects their Spotify account to their Discord profile, storing encrypted tokens in SQLite.
  2. Link detection: When users share Spotify track links in chat, the bot automatically extracts track IDs using regex pattern matching.
  3. Playback control: Right-clicking on messages with Spotify links reveals context menu options to either play immediately or add to queue.
  4. Token management: The bot automatically refreshes expired access tokens using refresh tokens, ensuring seamless operation without user intervention.
  5. Device integration: The bot detects active Spotify devices and plays music on the first available device, with fallback error handling.

What I built (scope & responsibilities)

Design choices that make it robust