close all voices on main WS close

This commit is contained in:
MathMan05
2026-07-21 22:19:42 -05:00
parent 7e36dbc6e0
commit 4439f96982
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -640,6 +640,7 @@ class Localuser {
ws.addEventListener("close", async (event) => {
this.ws = undefined;
this.voiceFactory?.close();
console.log("WebSocket closed with code " + event.code);
if (
(event.code > 1000 && event.code < 1016 && this.errorBackoff === 0) ||
+5
View File
@@ -280,6 +280,11 @@ class VoiceFactory {
obj.token = update.d.token;
obj.gotUrl();
}
close() {
Array.from(this.voiceChannels).forEach((_) => {
_[1].leave();
});
}
}
export type voiceStatusStr =
| "done"