v2.0 — All-in-one media player
Stream from YouTube, Spotify, SoundCloud, Bandcamp & Twitch. Built with Python 3.10+ and discord.py 2.4.
A versatile Discord bot built from scratch with Python. The goal is simple: combine all premium music bot features into a single open-source project.
Plays tracks from YouTube, Spotify (auto-resolved through YouTube), SoundCloud,
Bandcamp, Twitch, and anything else yt-dlp supports. Just /play <title>
or paste a URL — the bot will join your voice channel, queue the track, and
deliver an interactive embed with 8 control buttons.
Features 25+ slash commands, per-user save/load playlists, automatic lyrics via lrclib.net, play stats tracking, a DJ role to restrict who can skip/stop, and 24/7 mode for music servers.
bot.py # Entry point + 25+ slash commands player.py # Per-guild playback engine + queue sources.py # Multi-source resolver (YouTube/Spotify/SoundCloud) views.py # Now-playing embed + 8 interactive buttons lyrics.py # lrclib.net lyrics fetcher database.py # SQLite layer (playlists/settings/stats)
Stream directly from YouTube, Spotify, SoundCloud, Bandcamp, and Twitch. Auto-fallback when one source goes down.
Fast-forward, rewind, or jump to any position in a track. Instant skips with no loading delay.
Three modes: off, loop track, loop queue. Perfect for study sessions.
Range from 0–200%. Push above the original level when the source audio is too quiet.
View the full track list with duration and requester. The queue persists even if the bot briefly disconnects.
Shuffle the queue order or remove specific tracks by position. Total flexibility.
Save the current queue as a playlist (per user, per server). Load any time — the bot re-resolves URLs so they never expire.
Auto-fetch lyrics via lrclib.net. No API key, no rate limits. Synced lyrics supported too.
Top 10 most-played tracks per server or per user. Automatic medals for the top three.
Bot stays in the voice channel forever, even with no listeners. Great for lounge / study servers. Admin only.
Restrict skip/stop/clear to a specific role. Admins always bypass. Restrictions can be removed any time.
Auto-updating embed with thumbnail, duration, queue length, requester, loop status, and an up-next preview.
Rewind, pause/resume, skip, fast-forward, stop, shuffle, loop, queue. All accessible without typing a thing.
"Listening to /help to view commands" — users immediately know how to get started.
Disconnects automatically after being alone for 60 seconds. Saves resources. Can be disabled via /247.
| Command | Description |
|---|---|
/play <query> | Play a YouTube/Spotify/SoundCloud URL or search term |
/pause | Pause playback |
/resume | Resume playback |
/skip DJ | Skip to the next track |
/stop DJ | Stop and clear the queue |
/leave | Disconnect the bot from voice |
/forward [seconds] | Fast-forward (default 10s) |
/rewind [seconds] | Rewind (default 10s) |
/seek <seconds> | Jump to a specific position |
/queue | View the track queue |
/nowplaying | Show the currently playing track |
/shuffle | Shuffle the queue |
/remove <position> | Remove a track at a specific position |
/clear DJ | Clear the queue |
/loop <mode> | off / track / queue |
/volume <percent> | 0–200% (default 50%) |
/lyrics [query] | Lyrics for the current track or by title |
/stats [scope] | Top tracks (server / me) |
/playlist save <name> | Save the current queue as a playlist |
/playlist load <name> | Load a saved playlist into the queue |
/playlist list | List your saved playlists |
/playlist delete <name> | Delete a saved playlist |
/247 | Toggle 24/7 mode (Manage Server) |
/djrole [@role] | Set DJ role (leave empty to remove) |
/help | Show all commands |
# Clone & enter project cd discord-music-bot python -m venv venv venv\Scripts\activate pip install -r requirements.txt
# Quick install on Windows: winget install Gyan.FFmpeg # Verify: ffmpeg -version
# Open: https://discord.com/developers/applications # 1. New Application -> Bot tab -> Reset Token -> copy # 2. Enable MESSAGE CONTENT INTENT # 3. OAuth2 URL Generator -> bot + applications.commands # 4. Invite the bot to your server cp .env.example .env # Edit .env, paste token & GUILD_ID
python bot.py # Output: # Logged in as MusicBot#1234 # Database ready # Synced 25 slash command(s) (INSTANT) # Bot is ready! 🎵