Describe the bug
After destroying a player, Lavalink sends back an "event" event describing the websocket close. This event recreates the player and puts it into a "stuck" state. This is caused by Lavalink changing the available values of the type property to include websocket close events.
To Reproduce
Steps to reproduce the behavior:
Create a player by playing something using the Player#play method
Destroy the player using the Player#destroy method
Wait a short bit (200ms is probably plenty)
The player still exists and is in a stuck state
Expected behavior
The player should be destroyed and not recreated.
Screenshots
Additional context
Reported by a user in the Discord server. Unable to reproduce personally, but likely caused by a newer version of Lavalink. Unsure which Lavalink version.
Fixing this problem will involve adjusting the available event types.
Describe the bug After destroying a player, Lavalink sends back an "event" event describing the websocket close. This event recreates the player and puts it into a "stuck" state. This is caused by Lavalink changing the available values of the
type
property to include websocket close events.To Reproduce Steps to reproduce the behavior:
Player#play
methodPlayer#destroy
methodExpected behavior The player should be destroyed and not recreated.
Screenshots
Additional context Reported by a user in the Discord server. Unable to reproduce personally, but likely caused by a newer version of Lavalink. Unsure which Lavalink version.
Fixing this problem will involve adjusting the available event types.
Changing https://github.com/lavalibs/lavalink.js/blob/3b2bc663915283e917ba68c586dc8a5550cdeb1a/src/core/Connection.ts#L46 to check for the existence of the player should resolve this issue.