Lavalink icon indicating copy to clipboard operation
Lavalink copied to clipboard

Add Rest endpoint (GET players informations)

Open flav-code opened this issue 1 year ago • 2 comments

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
}

flav-code avatar Sep 09 '22 14:09 flav-code

you should then also add some sort of client sided info tracking...

that would return of all clients.

Tomato6966 avatar Sep 10 '22 15:09 Tomato6966

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.

devoxin avatar Sep 10 '22 16:09 devoxin

to provide an update here. The current rest-api proposal in https://github.com/freyacodes/Lavalink/pull/750 would cover this

topi314 avatar Oct 31 '22 12:10 topi314