🎵 A self-hosted Discord music bot with YouTube support
- Install yt-dlp and ffmpeg
- Get the latest release for your platform
- Eventually, build the project from source with
cargo run --release
| Command | What it does |
|---|---|
/play <url or query> |
Queue a song from YouTube, or a Spotify track link |
/search <query> |
Pick from the top 5 YouTube results |
/queue |
Bring the player panel to the bottom of the channel |
/skip · /prev |
Move through the queue |
/stop |
Stop, clear the queue and leave |
/now-playing |
What's on right now |
/remove <n> · /clear |
Drop one song or all pending ones |
/shuffle |
Shuffle the queue; turning it off restores the order tracks were added in |
/repeat <off|all|one> |
Repeat mode |
/history |
Recently played here |
/playlist save <name> |
Save the queue |
/playlist play <name> |
Queue a saved playlist |
/playlist list · /playlist show <name> |
What's saved, and what's in it |
/playlist import <url> [name] |
Import from a Spotify or YouTube playlist URL |
/playlist delete <name> |
Drop a saved playlist |
/normalize |
Level out the loudness |
/nightcore |
Pitch and speed everything up |
/speed <0.5-2.0> |
Playback speed |
Playlists belong to the server and names autocomplete. Spotify links are read off the public embed page, so they need no API key; each track is then matched to a YouTube video and played from there. Imports stop at 100 tracks.
Playback posts one self-updating message per server:
- Cover art, progress bar, live countdown
- Artist, who queued the track, which filters are on
- The next five tracks and who asked for each
- Buttons for prev / pause / skip / repeat / shuffle, paging, clear, stop, filters
- A menu to pick a queued track, then remove it, move it to the top, or play it now
Changing a filter resumes at the same second instead of restarting, and the
setting survives a restart. /queue re-posts the panel at the bottom.
Only people in the bot's voice channel can use the buttons or the commands.
- Create a new application for the bot account
- Copy the generated token to
.envfile or defineDISCORD_TOKENenvironment variable - Add the application to your server using the generated install link
Settings, history and playlists live in a SQLite file, downloaded audio in a
size-capped cache directory. See .env.example for the paths and other knobs.
- Docker image
- More sources (Spotify, SoundCloud, etc.)