Closed EvilG-MC closed 4 months ago
you need to call node.updateSession(true) in order to activate resuming. Then you can provide the sessionId in the node connect / create options, and it will resume, if connected during the duration. However you have to manually re-create the players and the queue on the client yourself. The queue can be stored externally and resynced via queue.utils.sync() On a resumed session nodeManager emits a "resumed" event.
aka See readme
https://github.com/Tomato6966/lavalink-client?tab=readme-ov-file#version-200
# Node Resuming got supported
# First enable it by doing: (It's now called updateSession)
+ await player.node.updateSession(true, 360_000);
# then when reconnecting to the node add to the node.createeOptions the sessionId: "" of the previous session
# and after connecting the nodeManager.on("resumed", (node, payload, players) => {}) will be executed, where you can sync the players!
# Node Options got adjusted # It's a property not a method should be treated readonly
+ node.resuming: { enabled: boolean, timeout: number | null };
I see, thank you so much!
What I mean is, when a node goes offline, all players go offline.
Then, the manager tries to reconnect to the node and the player plays again.
With shoukaku this is automatically, but in the case of
lavalink-client
, what would it be like? Because if you put thesessionId
in the nodes array, in My case it didn't seem to work.