Skip to content

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎵 A self-hosted Discord music bot with YouTube support

Installation

  1. Install yt-dlp and ffmpeg
  2. Get the latest release for your platform
  3. Eventually, build the project from source with cargo run --release

Commands

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.

The panel

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.

Usage

  1. Create a new application for the bot account
  2. Copy the generated token to .env file or define DISCORD_TOKEN environment variable
  3. 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.

TODO:

  • Docker image
  • More sources (Spotify, SoundCloud, etc.)

About

🎵 A self-hosted Discord music bot with YouTube support

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages