Session Resuming
Framelink supports session resuming for both Lavalink v3 and v4. This ensures that playback is not interrupted if the bot's WebSocket connection to Lavalink is briefly lost.
Configuration
To enable resuming, you must provide a resumeKey in your node options:
typescript
const manager = new LavalinkManager({
nodes: [
{
host: 'localhost',
port: 2333,
password: 'youshallnotpass',
version: 'v4',
resumeKey: 'my-secret-key',
resumeTimeout: 60 // Time in seconds to wait for a reconnect
}
],
// ...
});How it Works
- v3: The manager sends a
configureResumingop code to Lavalink immediately upon connection. - v4: The manager uses the REST API to patch the session configuration once the
readyevent (which provides thesessionId) is received.
Benefits
- Players will continue playing while the bot is reconnecting.
- Once reconnected, the bot will take over the existing players without audio gaps.
- The
nodeConnectevent will still fire, but the players will persist.
