A simple Discord music bot built with Python, discord.py, and yt-dlp that allows users to play music directly from YouTube into Discord voice channels using text commands.
This project is designed as a learning-friendly music bot with a basic queue system and easy setup.
- 🔊 Play audio from YouTube using search keywords
- 📜 Basic queue system for songs
- ⏭️ Skip the currently playing song
- 🤖 Command-based interaction (
!play,!skip) - 🎧 Automatically joins and plays music in voice channels
- Python 3.8+
- discord.py
- yt-dlp
- FFmpeg
- asyncio
Make sure you have the following installed:
- Python 3.8 or higher
- FFmpeg (must be added to system PATH)
Install Python dependencies:
pip install discord.py yt-dlpgit clone https://github.com/Thakuma07/Discord-Music-Bot.git
cd Discord-Music-Bot- Go to the Discord Developer Portal
- Click New Application and give it a name
- Open the Bot section from the sidebar
- Click Add Bot and confirm
- Copy the Bot Token (keep this secret)
- Enable the following settings:
- ✅ Message Content Intent
- ✅ Server Members Intent (optional)
- Set required bot permissions:
- Connect
- Speak
- Generate an invite link using the OAuth2 → URL Generator
- Scopes:
bot - Bot Permissions:
Connect,Speak
- Scopes:
- Use the generated URL to invite the bot to your server
Make sure Python 3.8 or higher is installed, then run:
pip install discord.py yt-dlp