- Play: The play command takes a YouTube URL as an argument and plays the song in the voice channel that the bot is connected to.
- Skip: The skip command skips the current song.
- Stop: Stops the current playback in the connected channel and disconnects.
The bot will automatically delete the cached file of a played song after it ends. This is to prevent the file from taking up too much space on the bot's hard drive.
Please make sure that the following intents are enabled under Bot
settings in the discord developer portal for your application:
- Presence
- Server Members
- Message Content
- Python 3.11 or newer
- FFMPEG
To install dependencies, use the following command:
pip install -r requirements.txt
- Set the environment variable
DISCORD_TOKEN
to your bot token:
DISCORD_TOKEN="your token here"
- Run the bot with:
python bot.py
- 1.0.0: Initial release.
- 1.0.1: Added the ability to skip songs.
- 1.0.2: Added the ability to delete files after songs end.
- 1.0.3:
- Added new
stop
command & command descriptions - Improved YT-DLP options for greater stability.
- Disabled playlists from attempting to queue everything at once, which breaks the bot.
- Added new
- 1.0.4: Added new bot status messages, combined
disconnect
withstop
. - 1.0.5:
- Fixed some race conditions, skip command, and command layout.
- Added more error handling, & status improvements.
This script is for educational purposes only. Use it at your own risk. The developer is not responsible for any damage caused by the misuse of this script.