Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VoiceConnection disconnect event not emitting #1437

Open
xenorio opened this issue Dec 5, 2022 · 1 comment
Open

VoiceConnection disconnect event not emitting #1437

xenorio opened this issue Dec 5, 2022 · 1 comment

Comments

@xenorio
Copy link

xenorio commented Dec 5, 2022

When the client is forcefully disconnected from a voice channel (right click -> disconnect), or possibly other mean as well, the disconnect event does not emit. This means there's no way to detect this, streams will just keep trying to play, hilarity ensues.

Whenever the websocket closes with 4014: Disconnected and there's a channel (not sure why there wouldn't be one), it is setting reconnecting = true, therefore not emitting the disconnect event.

} else if(code === 4014) {
if(this.channelID) {
data.endpoint = null;
reconnecting = true;
err = null;
} else {
reconnecting = false;
}

When it eventually tries to reconnect, it's getting stuck here:

if(!data.endpoint) {
return; // Endpoint null, wait next update.
}

What I personally think should happen: When it gets disconnected for any reason that is not an error, it shouldn't even try to reconnect and just fire the disconnect event. Users should be able to decide themselves if they want to reconnect or not. If this behavior needs to stay for some reason, maybe a "reconnect" option for channel.join(), being true by default for backwards compatibility.

@bsian03
Copy link
Collaborator

bsian03 commented Jul 8, 2024

Will look into this when I get the chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants