summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-30 18:41:25 -0700
committerFuwn <[email protected]>2025-09-30 18:41:25 -0700
commitdbe0ea5ea946209e6f2a8a0d0d261ec213c1f5e4 (patch)
tree23a904ca344ffb7268597c83c2c58fbfa4dad2be
parentfix(gateway:moderationAgent): Update model response handling (diff)
downloadumabotdiscord-dbe0ea5ea946209e6f2a8a0d0d261ec213c1f5e4.tar.xz
umabotdiscord-dbe0ea5ea946209e6f2a8a0d0d261ec213c1f5e4.zip
fix(listeners:voiceConnection): Handle errors
-rw-r--r--packages/gateway/src/listeners/voiceConnection.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/gateway/src/listeners/voiceConnection.ts b/packages/gateway/src/listeners/voiceConnection.ts
index 04f2b32..1bf51b7 100644
--- a/packages/gateway/src/listeners/voiceConnection.ts
+++ b/packages/gateway/src/listeners/voiceConnection.ts
@@ -28,6 +28,12 @@ export const handleVoiceConnection = (client: Client) => {
const player = createAudioPlayer();
connection.subscribe(player);
+ connection.on('error', (error) => {
+ console.error("Voice connection error:", error);
+ setTimeout(() => {
+ handleVoiceConnection(client);
+ }, 15000);
+ });
connection.on(VoiceConnectionStatus.Disconnected, () => {
setTimeout(() => {
try {
@@ -39,6 +45,12 @@ export const handleVoiceConnection = (client: Client) => {
const newPlayer = createAudioPlayer();
newConnection.subscribe(newPlayer);
+ newConnection.on('error', (error) => {
+ console.error("Voice reconnection error:", error);
+ setTimeout(() => {
+ handleVoiceConnection(client);
+ }, 15000);
+ });
newConnection.on(VoiceConnectionStatus.Disconnected, () => {
setTimeout(() => {
handleVoiceConnection(client);