mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-08-27 22:34:17 +00:00
close all voices on main WS close
This commit is contained in:
@@ -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) ||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user