A simple, lag-free Discord music bot that streams music directly from YouTube.
- 🎵 Stream music from YouTube
- ⚡ Optimized for minimal lag
- 🎮 Simple slash commands
- 📝 Queue management
- ⏸️ Playback controls (pause, resume, skip)
/join- Join your voice channel/play <url>- Play a song from YouTube/pause- Pause the current song/resume- Resume playback/skip- Skip to the next song/stop- Stop playing and clear the queue/queue- Show the current queue/leave- Leave the voice channel
- Python 3.10 or higher
- FFmpeg installed on your system
- Discord Bot Token
git clone https://github.com/YOUR_USERNAME/MusicMan.git
cd MusicManpython -m venv discord_bot_envWindows:
discord_bot_env\Scripts\activateLinux/Mac:
source discord_bot_env/bin/activatepip install -r requirements.txtWindows:
- Download from https://www.gyan.dev/ffmpeg/builds/
- Extract to
C:\ffmpeg - Add
C:\ffmpeg\binto your PATH
Mac:
brew install ffmpegLinux (Ubuntu/Debian):
sudo apt update && sudo apt install ffmpeg- Go to Discord Developer Portal
- Create a new application
- Go to the "Bot" tab and create a bot
- Enable these Privileged Gateway Intents:
- ✅ Message Content Intent
- ✅ Server Members Intent
- Copy your bot token
- Go to OAuth2 → URL Generator
- Select scopes:
bot,applications.commands - Select permissions:
Connect,Speak,Use Voice Activity,Send Messages,Read Message History
- Select scopes:
- Use the generated URL to invite the bot to your server
Create a .env file in the project directory:
DISCORD_BOT_TOKEN=your_bot_token_herepython music_bot.pyYou should see:
🤖 Starting Discord Music Bot...
✅ Bot is ready! Logged in as MusicMan#XXXX
📊 Connected to X server(s)
🔄 Synced 8 command(s)
- Join a voice channel in your Discord server
- Use
/jointo make the bot join your channel - Use
/play <youtube_url>to play music - Enjoy! 🎶
- Make sure FFmpeg is installed and in your PATH
- Verify the bot has proper permissions in your Discord server
- Check that you've enabled the Server Members Intent in the Developer Portal
- Check your internet connection
- Try using a different voice server region in Discord server settings
- Make sure you've invited the bot with
applications.commandsscope - Wait a few minutes for Discord to sync the commands
- Try kicking and re-inviting the bot
Feel free to fork this project and submit pull requests!
This project is open source and available under the MIT License.
- Built with discord.py
- Uses yt-dlp for YouTube integration
- Powered by FFmpeg for audio processing