A Discord bot for playing music from YouTube with slash commands.
- π΅ Play music from YouTube (search or URL)
- π Queue management (add, remove, clear)
- β―οΈ Playback controls (play, pause, resume, skip)
- π€ View user profile pictures
- π Latency check
simple-discord-bot-python/
βββ src/
β βββ bot.py # Bot initialization
β βββ cogs/
β β βββ music.py # Music commands
β β βββ general.py # Utility commands
β βββ services/
β β βββ youtube.py # YouTube audio service
β βββ utils/
β βββ helpers.py # Helper functions
βββ config/
β βββ settings.py # Configuration
βββ main.py # Entry point
βββ requirements.txt
βββ Dockerfile
βββ .env.example
| Command | Description |
|---|---|
/play <search> |
Play music from YouTube |
/stop |
Pause the current music |
/resume |
Resume paused music |
/skip |
Skip to the next song |
/join |
Join your voice channel |
/disconnect |
Leave the voice channel |
/queue |
Show the music queue |
/clear |
Clear the queue |
/nowplaying |
Show current song |
/removequeue <index> |
Remove song from queue |
/ping |
Check bot latency |
/profile <user> |
View profile picture |
-
Clone the repository
git clone https://github.com/yourusername/simple-discord-bot-python.git cd simple-discord-bot-python -
Create virtual environment
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Configure environment
cp .env.example .env # Edit .env and add your Discord token -
Run the bot
python main.py
docker build -t discord-bot .
docker run -d --env-file .env discord-bot- Python 3.11+
- FFmpeg (for audio playback)
- Discord Bot Token
MIT