A simple discord music bot to stream from a local library of files
Python Libraries: discord.py, pysox (https://github.com/rabitt/pysox), requires sox to be installed)
Binaries: FFMPEG, FFPROBE (https://www.ffmpeg.org/download.html), SOX (updated link can be found in the pysox github readme)
- Install Sox, ffmpeg, and ffprobe binaries **THESE MUST BE IN YOUR OS PATH**
- Go to https://discord.com/developers/applications and create an application, then add a bot to it.
- Ensure both message and server member intents are enabled, then generate a client authentication token
- Create ‘songdir.txt’, and enter a windows URL pointing to the directory containing your music files.
- Create ‘key.txt’, and enter your bot’s authentication key from the discord developer portal.
- Place these files in the same directory as the bot.
- Add your client ID into this link to invite your bot: https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&permissions=274881432640&scope=bot
Command Name | Aliases | Description |
---|---|---|
Join | getoverhere , join , c | Connects the bot to the voice channel the author is connected to. |
Leave | fuckyou , leave , dc | Disconnects the bot from voice. |
Shuffle Play | shuffle , s | Plays random song on loop until stopped, clears the queue on activation. |
Stop | stop , st | Stops shuffling and clears the queue. |
Skip | skip , sk | Skips the current song. |
Pause | pause , p | Pauses the currently playing song. |
Resume | resume , r | Resumes the currently playing song. |
Volume | volume , v | Sets the volume to a decimal value 0.01 to 1.00. |
Seek | seek , se | Seek to time given an integer value in seconds. |
Now Playing | nowplaying , np | Show a progress bar for the current song. |
Replay | replay , re | Replays current song. |
Fuzzy | fuzzy , f | Does a simple fuzzy search for the argument in quotes, adds the result to the queue and stops shuffling. |
Keyword Search | keyword , key | Searches for matches containing all keywords, adds the result to the queue and stops shuffling. |
Distort | distort , LOUDER | Heavily distorts current song, and toggles distorted mode on or off. Optionally takes an integer 5-50 as an argument to set magnitude. |
Loop | loop , l | Toggle continuous playback of the currently playing song on or off. |
Queue Remove | qremove , qr | Removes the song at the specified integer position in the queue. |
Queue Clear | qclear , qc | Clears the queue. |
Queue Swap | qswap , qs | Swaps the positions of 2 songs in the queue given their integer positions as arguments. |
Queue Remove | qview , qv | Display all songs currently in queue and their positions. |