How to Setup Lavalink
Lavalink is a standalone audio sending node. It's required to use FlawBOT's music commands. FlawBOT 5.0 uses Lavalink v4. Older Lavalink v3 servers are no longer supported.
- Install Java 17 or newer.
- Download Lavalink.jar from the latest Lavalink v4 release.
- Put Lavalink.jar in the same folder as the application.yml file that ships with FlawBOT (in the
Resourcesfolder). - Open application.yml and change
addressto the IP of the machine you'll be running Lavalink from. Use0.0.0.0to listen on every network interface. Also change thepassword.
server: # REST and WS server
port: 2333
address: 192.168.2.38
lavalink:
server:
password: "youshallnotpass"
- Open config.json and change
Address,PortandPasswordto match the values set in Step 4. SetEnabledto true.
"Lavalink": {
"Enabled": true,
"Address": "192.168.2.38",
"Port": 2333,
"Password": "youshallnotpass"
}
- Open the command prompt in that folder and start Lavalink by entering:
java -jar Lavalink.jar - Start FlawBOT. The
/musiccommands are only registered when Lavalink is enabled.
YouTube playback
YouTube support in Lavalink v4 is provided by the youtube-source plugin. The included application.yml already enables it and disables Lavalink's old built-in YouTube source. Lavalink downloads the plugin automatically on first start.
YouTube changes often, so if playback stops working, update the plugin version in application.yml to the latest release and restart Lavalink:
lavalink:
plugins:
- dependency: "dev.lavalink.youtube:youtube-plugin:1.18.2"
note
Lavalink must be running before you use any music command. If FlawBOT can't connect, it logs "Exception occurred when connecting the lavalink node." and the other commands keep working.