Updated structure

This commit is contained in:
2026-01-09 19:56:44 +01:00
parent 6a7ea0cd8d
commit 5c4526e578
11 changed files with 197 additions and 169 deletions
+4 -1
View File
@@ -13,7 +13,7 @@ export interface NodeCallbacks {
onVoiceJoin?: (userId: string, channelId: string, voiceId: number) => void;
onVoiceLeave?: (userId: string, channelId: string, voiceId: number) => void;
onSpeaking?: (voiceId: number) => void;
};
}
export class NodeClient {
private ws: WebSocket | null = null;
@@ -57,6 +57,7 @@ export class NodeClient {
}
disconnect() {
console.log("Disconnecting");
this.ws?.close();
this.ws = null;
}
@@ -78,6 +79,8 @@ export class NodeClient {
const data = JSON.parse(e.data);
console.log("Message received:", data);
if (data.error) {
toast.error(`Error from ${this.name} (${data.error})`, {
description: data.message,