A Discord music bot that plays YouTube audio, manages a queue, and lets you save playlists — backed by SQLite.
-
Clone the repo onto your machine or Raspberry Pi.
-
Create a
.envfile in the project root:DISCORD_TOKEN=your_discord_bot_token_here GUILD_ID=your_server_id_here -
Run with Docker:
docker compose up -d --build
The bot will start automatically and restart if it crashes. The database is saved in
./data/bot.db. -
Run locally (Windows) without Docker:
dc_env\Scripts\activate pip install -r requirements.txt python MyBot.py
Make sure
bin\ffmpeg\ffmpeg.exeexists, or addFFMPEG_EXECUTABLE=path\to\ffmpeg.exeto your.env.
| Command | What it does |
|---|---|
/play <song> |
Search YouTube and play a song. If something is already playing, it gets added to the queue instead. |
/skip |
Skip the current song and play the next one in the queue. |
/stop |
Stop playback, clear the queue, and disconnect the bot from voice. |
/queue |
Show what's currently playing and what's coming up next. |
Playlists are saved permanently in the database and shared across the whole server.
| Command | What it does |
|---|---|
/playlist create <name> |
Create a new empty playlist. |
/playlist add <name> <song> |
Search for a song and add it to the playlist. |
/playlist play <name> |
Load all songs from a playlist into the queue and start playing. |
/playlist list |
Show all playlists in this server. |
/playlist view <name> |
Show all songs in a playlist with their position numbers and durations. |
/playlist remove <name> <position> |
Remove a song from a playlist by its position number (use /playlist view to find it). |
/playlist delete <name> |
Permanently delete a playlist. Only the person who created it can do this. |
dc_env\Scripts\activate