Lavalink
Lavalink copied to clipboard
Add Rest endpoint (GET players informations)
Why this feature ? :
This function could be used if you had connection problems, so you will be able to see the info of your lavalink players to resynchronize them. Sometimes the music bugs and I want to check if the music is still playing on lavalink
Route: GET /players
Headers:
Authorization: "youshallnotpass"
userId: "684773505157431347"
Exemple of response :
[
{
"guild_id": "699989534724849685", // Player guild ID
"connected": true, // Internal lavalink connection state
"playing": true, // If player is currently playing
"track": "base64track" // Base64 track if playing or undefined
},
{
"guild_id": "125227483518861312", // Player guild ID
"connected": true, // Internal lavalink connection state
"playing": false, // If player is currently playing
"track": undefined // Base64 track if playing or undefined
}
]
Route: GET /player/:guildId
Headers:
Authorization: "youshallnotpass"
userId: "684773505157431347"
Exemple of response :
{
"guild_id": "699989534724849685", // Player guild ID
"connected": true, // Internal lavalink connection state
"playing": true, // If player is currently playing
"track": "base64track" // Base64 track if playing or undefined
}
you should then also add some sort of client sided info tracking...
that would return of all clients.
you should then also add some sort of client sided info tracking...
that would return of all clients.
This should really be a separate issue. But my first thought is that this is redundant, though I'm interested to hear your use case for such a feature. Generally speaking if it's just you connecting to Lavalink your client should already be aware of itself.
to provide an update here. The current rest-api proposal in https://github.com/freyacodes/Lavalink/pull/750 would cover this