A Discord bot with more than 30 + commands which allows playing music on your server efficiently. Supports YouTube, Spotify, Deezer and Soundcloud links.
- create a discord application / bot here
- Install all dependencies :
pip install -r requirements.txt
. - Download Lavalink.
- Install Java 11+
- Create a MySQL database and use the
Scripts/generateDatabase.sql
file to create the table. - Edit
configuration example.json
:
{
"token": "", // Your bot token
"prefix": "-", // Your prefix
"playlistLimit": "15", // Optional - Defaults to 15 if not provided 0 is unlimited
// Spotify => https://developer.spotify.com/dashboard/
"spotifyClientId": "", // Your Spotify ID (OPTIONAL : Spotify links support)
"spotifyClientSecret": "", // Your Spotify secret (OPTIONAL : Spotify links support)
"MySQLHost": "", // Your MySQL host
"MySQLLogin": "", // Your MySQL login
"MySQLPasword": "", // Your MySQL password
"MySQLDatabase": "" // Your MySQL database
}
- Rename it to
configuration.json
. - Edit
emojis.json
Finally, host the bot and invite it to your own server.
- Run
Lavalink.jar
(from Lavalink) withjava -jar Lavalink.jar
- Note: you will likely want to use a config file in the same directory as
Lavalink.jar
to control its settings
- Note: you will likely want to use a config file in the same directory as
- Run the bot
python3 main.py
- skip all but the first installation steps above
- install docker
- install docker-compose
- copy the configuration.docker.json file to
./configuration.json
- fill in your discord bot token
- optionally the spotify client id/secret && dbl tokens
- run
docker-compose build
- run
docker-compose up -d db
- run
docker-compose up -d
Note: In theory you can skip
docker-compose up -d db
and just rundocker-compose up -d
but the timing of the db startup and running of the generateDatabase.sql on initial startup can sometimes cause the music bot to fail to start so its best to just start the db first to give it enough time
- you can run
docker-compose logs
to view logs for all services - you can run
docker-compose logs <service>
eg:docker-compose logs musicbot
to see the logs for a specific service (look in the compose file for the service names) - you can run
docker-compose stop
to stop the music bot / db / lavalink containers - you can run
docker-compose start
to start the music bot / db / lavalink after stopping
- Play music from YouTube
- Support links from YouTube, Spotify, Deezer and Soudcloud
- Support YouTube lives
- Support playlists from Spotify, Deezer, Soundcloud and YouTube
- Playlist system
- Many commands
- Complex queue commands
-play(p) <Url/Query> : Search on youtube and play the music.
-search <Query> : Search a song on youtube.
-nowplaying : Display data about the current song.
-join(j) : Add the bot to your voice channel.
-leave(dc) : Remove the bot of your voice channel.
-pause : Pause the current song.
-resume : Resume the current song.
-volume(vol) <0-100> : Change the bot's volume.
-queue(q) : Display the queue.
-shuffle : Shuffle the queue.
-move <IndexFrom> <IndexTo> : Move a song in the queue.
-remove(r) <Index> : Remove the song with its index.
-removedupes : Remove all duplicates song from the queue.
-leavecleanup : Remove absent user's songs from the queue.
-clear : Clear the queue.
-replay : Replay the current song.
-reload(rd) : Reload the current song.
-loop : Enable or disable the loop mode.
-loopqueue(lq) : Enable or disable the loop queue mode.
-seek <time> : Play the song from specific times.(ex: -seek 1:30 it mean the song will play from 1m30s positions)
-skipto(sto) <index>: Play song from specific location in queue.
-lyrics: to see the lyrics.
-playlist(pl) display : Display playlist's names.
-playlist(pl) add <playlist_name> <Url/Query> : Add a track to your playlist.
-playlist(pl) remove <playlist_name> <Index> : Remove a track to your playlist.
-playlist(pl) show <playlist_name> : Display playlist's songs.
-playlist(pl) load : Add the whole playlist to the queue.
-stats : Display the bot's stats.
-support : Give a link to join the support server.
-invite : Give a link to invite the bot.
-vote : Give the Top.gg link to vote for the bot.
-help : Display the help.
-logout : Stop the bot process.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.