TQ — portfoliocontact ↗
Backend & Cloud

Hoppon Bot

Scalable Discord bot supporting 30+ concurrent users for music streaming via Spotify and YouTube APIs

Hoppon Bot screenshot
01/ Overview

Hoppon, a play on "hop on", is a Discord bot I built for my friends' server. It streams music into voice channels from a search, a YouTube link or a Spotify track, album or playlist, keeps a shared queue, and can autoqueue similar songs so the music keeps going. It also covers the small things the server used, like polls, coin flips, random numbers and prayer times, and it runs in Docker on AWS EC2.

02/ Problem

Instead of juggling several general-purpose bots, my friends and I wanted one built around how we actually used our server: music with a shared queue that understood both YouTube and Spotify links, plus quick polls and a few everyday utilities.

03/ Approach

The bot is a discord.py cog with 15 commands, with the music logic in its own class. Searches and YouTube links go through yt-dlp for audio metadata, which is queued and streamed into the voice channel with FFmpeg, and each track's completion callback starts the next one. Spotify links are resolved with Spotipy, mapping every track in an album or playlist to a YouTube match. Autoqueue parses the artist and title of the last song, asks Spotify for a recommendation and queues the closest YouTube result. Along the way I fixed audio cutting out mid-song and started fetching and caching YouTube results as soon as a song is queued, then containerized the bot with Docker and deployed it on AWS EC2.

04/ Outcome
30+concurrent users
15commands, including 3 ways to queue music (search, YouTube, Spotify)
EC2containerized with Docker on AWS

Hoppon runs our server from an EC2 instance, and the README documents the setup so anyone can clone it, add their own tokens and run it locally or in Docker. Still on the list are smarter search suggestions and friendlier error handling for bad input.