This is a Discord bot built using Python, discord.py, youtube-dl, and ffmpeg. It allows users to play music in a voice channel, with commands to join, play, pause, resume, and disconnect from the voice channel.
Before you begin, ensure you have met the following requirements:
- You have a Discord account.
- You have created a Discord bot and obtained its token.
- You have Python installed on your machine.
- You have installed
ffmpegon your machine. You can download it from here.
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.envfile in the root directory and add your Discord bot token:TOKEN=YOUR_DISCORD_BOT_TOKEN
-
Run the bot:
python bot.py
-
Invite the bot to your server using the OAuth2 URL with the necessary permissions.
-
Use the following commands in your Discord server:
?join: Make the bot join your current voice channel.?disconnect: Disconnect the bot from the voice channel.?play <YouTube URL>: Play the audio from the provided YouTube URL.?pause: Pause the currently playing audio.?resume: Resume the paused audio.
bot.py: The main script to run the bot.music.py: Contains the music-related commands and functionality.responses.py: Contains the response handling logic (not detailed in this README).requirements.txt: Lists the dependencies required for the bot..env: File to store your Discord bot token (not included in the repository).
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please fork the repository and submit a pull request.
For any issues or questions, please open an issue on the GitHub repository.