How it works
Last updated
Last updated
First you have to create a manager:
TIP: I'd recommend adding the manager to the client, like this: client.manager = new LavalinkManager...
Create a player:
Connect the player
Search with the player:
Add the search result tracks / first result track (single) to the queue:
In order to play the next song of the queue:
if you are playing a song, and want to play the next song, you have to run:
If you want to leave channel, run player.disconnect()
, you can then change voice channel and run player.connect()
again.
If you want to stop playing and re-create the player, run:
To get the Player after it was created somewhere else, use:
Wanna know if a track Starts to play / ends playing, queue ends. etc. etc. Then listen to events!
For more information, also such as automated options for manager / players, check out the Documentation Page