This is a Python Discord bot that provides music-related commands for your server with buttons included. This bot is designed to be used with the discord.py, Lavalink backend for audio streaming, processing and lastly Wavelink as wrapper.
- Play music from YouTube, Soundcloud, HTTP, Vimeo & Spotify(no playlist support yet, only links with
spotify.com/track
will work). - Create and manage a queue of songs.
- Display the currently playing song.
- Control playback (skip, pause, resume, stop).
- Adjust volume.
- Shuffle the queue.
- Repeat a song or the entire queue.
Before you can run the Music Bot, make sure you have the following dependencies installed:
- Python (Python 3.7 or higher)
- discord-py
- Wavelink
- Lavalink server running. VPS or Home PC.
Lavalink download on linux.
sudo yum update
sudo yum install wget
wget $(curl -s "https://api.github.com/repos/lavalink-devs/Lavalink/releases/latest" | grep 'browser_' | cut -d\" -f4)
wget https://raw.githubusercontent.com/lavalink-devs/Lavalink/master/LavalinkServer/application.yml.example -O application.yml
-
Download the Music Bot source code from this repository.
-
Set up and configure the necessary dependencies and environment for the bot, such as Python and the required libraries.
-
Run the bot using the appropriate command or script to start it. Should work on replit also because I am hosting my bot on replit and it works fine.
- Join a voice channel:
/play <query>
- Searches YouTube for a song and plays it in the user's voice channel. - Display the currently playing song:
/nowplaying
- Shows the song that is currently playing with a progress bar. - View queue:
/queue
- View current queue. - Skip the current song:
/skip
- Skips the current song and plays the next one in the queue. - Play the previous song:
/previous
- Plays the last song in the queue history. - Clear the queue:
/clear
- Clears the song queue. - Shuffle the queue:
/shuffle
- Shuffles the order of songs in the queue. - Pause playback:
/pause
- Pauses the currently playing song. - Resume playback:
/resume
- Resumes playback if it's paused. - Stop playback and disconnect:
/stop
- Stops playback and disconnects the bot from the voice channel. - Adjust volume:
/volume <volume>
- Sets the volume of the bot (0-100%). - Repeat all songs in the queue:
/repeatall
- Toggles repeat mode for the entire queue. - Repeat the current song:
/repeat
- Toggles repeat mode for the current song.
This bot is built using the discord.py, wavelink and Lavalink libraries. Special thanks to the developers of these libraries for making it possible to create such functionality.
This code is available under the Apache 2.0 License. Contact me for any details through discord/email or github.