A simple Discord music bot written in Python using the discord.py library.
This Discord music bot is designed to connect to a voice channel, play a specified audio file, and perform a basic random number generation command.
- Connect to a voice channel
- Play a specified audio file
- Generate a random number within a specified range
Make sure you have the following installed:
- Python (>=3.6)
- discord.py
- ffmpeg
-
Clone the repository:
git clone https://github.com/your-username/discord-music-bot.git cd discord-music-bot
-
Install dependencies:
pip install -r requirements.txt
-
Create a Discord bot and obtain the token.
-
Set the
BOT_TOKEN
environment variable:export BOT_TOKEN=your_bot_token_here
-
run the bot program
-
Invite the bot to your Discord server.
-
Use the following commands:
!join
: Join the user's voice channel.!leave
: Leave the current voice channel.!play
: Play a predefined audio file.!roll <max_val>
: Generate a random number between 1 and the specified<max_val>
.