Minimal Python self-hosted Discord MP3 music streaming BOT for your own Discord server.
Designed to run on Linux systems. It may or may not run on your Windows and Apple machines, addapting it for that is on you entirely.
Feature list:
'.play' - join 'General' voice channel and start streaming (Admin only).
'.stop' - stop playing and disconnect from voice channel (Admin only)
'.skip' - skip to next random mp3 file (Admin only)
'.quit' - stop bot and exit progma (Creator only, if you add your Discord ID to boombox.py)
Not designed for and not intended use case, but it will run fine on multiple servers at the same time, but with some eastetic issues: Status "playing" will update globaly every time it's shuffling for any of the servers - I have no plans to do anything about that.
sudo apt install ffmpeg
python3 -m pip install -U discord.py
python3 -m pip install -U pynacl
-
Create Bot in Discord Developer Portal and get API TOKEN: https://discord.com/developers/applications
-
Clone repository
git clone https://github.com/pugzly/boombox
cd boombox
- Edit file 'boombox.py' to add API TOKEN and change other preferences (feel free to change code to store token in env, encypted on blockchain, or under your mom's pillow)
# Edit bellow to add your own details
DISCORD_API_TOKEN = 'M2391576SZD-------REPLACE-THIS-WITH-DISCORD-API-TOKEN-OF-YOUR-BOT------Nj02947wND'
CREATOR_ID = 1000006900000001 # YOUR Discord User ID, only for command '.quit'
MUSIC_DIR = '/home/user/mp3' # Path to where your MP3's are stored
PREFIX = '.' # Replace this, if you want all your commands start with anything other than '.'
- Run
python3 boombox.py
Bonus: To keep it running even with terminal closed, start it with 'nohup'
nohup python3 boombox.py