You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when I move bot from channel to channel during active audio playback (doesn't matter if manually or via JDA) player is updated with a new endpoint, token, etc. but does not play audio.
I did a little digging in the code and noticed that this is due to the interception of the WebSocketClosedEvent event. Suggesting by error codes it appears that bot has disconnected from the channel (which is logical, since it connects to another one).
isMessage.EmittedEvent.WebSocketClosedEvent-> {
// These codes represent an invalid session// See https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codesif (event.code ==4004|| event.code ==4006|| event.code ==4009|| event.code ==4014) {
logger.debug("Node '{}' received close code {} for guild {}", node.name, event.code, event.guildId)
// TODO: auto-reconnect?
node.destroyPlayerAndLink(event.guildId.toLong()).subscribe()
}
}
else-> {}
When I remove the 4014 code it seems to work properly (it does not remove the player and link, and player on the lavalink server is updated and playing audio)
if (event.code ==4004|| event.code ==4006|| event.code ==4009) {
logger.debug("Node '{}' received close code {} for guild {}", node.name, event.code, event.guildId)
// TODO: auto-reconnect?
node.destroyPlayerAndLink(event.guildId.toLong()).subscribe()
}
This above solution is not very useful, because it won't capture in this way voice channel removed event, kicking bot from server event and finally doesn't remove player from the Lavalink server.
I wonder if the player is definitely updated with the new Discord sound gateway. My guess is that correctly one would have to delete player and create a new one. Is there any plan to implement changing the channel during audio playback function? If not how to handle this other than removing error code from if statement.
Lavalink-client version: 3.1.0
Lavalink:
Version: 4.0.8
Build time: 20.09.2024 20:20:10 UTC
Branch HEAD
Commit: 2946608
Commit time: 20.09.2024 20:17:58 UTC
JVM: 18.0.2.1
Lavaplayer 2.2.2
The text was updated successfully, but these errors were encountered:
Hi, when I move bot from channel to channel during active audio playback (doesn't matter if manually or via JDA) player is updated with a new endpoint, token, etc. but does not play audio.
I did a little digging in the code and noticed that this is due to the interception of the
WebSocketClosedEvent
event. Suggesting by error codes it appears that bot has disconnected from the channel (which is logical, since it connects to another one).Lavalink logs:
When I remove the
4014
code it seems to work properly (it does not remove the player and link, and player on the lavalink server is updated and playing audio)Lavalink logs:
This above solution is not very useful, because it won't capture in this way voice channel removed event, kicking bot from server event and finally doesn't remove player from the Lavalink server.
I wonder if the player is definitely updated with the new Discord sound gateway. My guess is that correctly one would have to delete player and create a new one. Is there any plan to implement changing the channel during audio playback function? If not how to handle this other than removing error code from if statement.
Lavalink-client version: 3.1.0
Lavalink:
The text was updated successfully, but these errors were encountered: