A fully functional discord music bot. All codes are given here. This is pretty advanced coding. It is recommended to get a upperhand on discord.py development before watching or using this code.
- This bot uses Lavalink. So it is required to run lavalink before runnig this bot.
- Lavalink player configuration file is also needed. You can get that from here. Keep the application.yml in the Lavalink.jar root directory.
- Wavelink python module is also required to link the bot to the lavalink player. But all wavelink versions may not work. I recommend to use wavelink v0.9.
Use the command below to install wavelink v0.9:
pip3 install wavelink<1
- Other usual discord.py libraries like discord, discord.py, discord.py[voice] etc are also recommended to have installed.
Lavalink is a standalone program which is written in Java. It is a lightweight solution for playing musics from sources like Youtube or Soundcloud. It can handle hundreads of concurrent streams & supports sharding.
As lavalink is written in java, a JDK is required to run it. Download OpenJDK from here.
Download Lavalink from here.
Everytime before running the bot lavalink will be required to run. Use the following command to do so:
java -jar lavalink_path/Lavalink.jar