From e9854d38a019fe8b0a24318edea8173ad5bf33eb Mon Sep 17 00:00:00 2001 From: xjuanfxx <126913334+xjuanfxx@users.noreply.github.com> Date: Sat, 4 Mar 2023 22:07:46 -0800 Subject: [PATCH 1/5] Update VoiceManager.js Solution to voice disconnection --- src/classes/VoiceManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/classes/VoiceManager.js b/src/classes/VoiceManager.js index 3fce2035..1949e125 100644 --- a/src/classes/VoiceManager.js +++ b/src/classes/VoiceManager.js @@ -28,7 +28,11 @@ class VoiceManager { selfDeaf: false, selfMute: false }); - + connection.on('stateChange', (old_state, new_state) => { + if (old_state.status === VoiceConnectionStatus.Ready && new_state.status === VoiceConnectionStatus.Connecting) { + connection.configureNetworking(); + } + }); // Resolve this voice manager once the connection is ready. connection.on(VoiceConnectionStatus.Ready, () => { connection.subscribe(this.player); From 491a3bd9a2eb64dd72ec6490287191dd880809bb Mon Sep 17 00:00:00 2001 From: xjuanfxx <126913334+xjuanfxx@users.noreply.github.com> Date: Sat, 4 Mar 2023 22:34:16 -0800 Subject: [PATCH 2/5] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb35ad28..e13544ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-tts-bot", - "version": "4.1.1", + "version": "4.1.2", "description": "A simple Discord TTS Bot that uses the Google Translate TTS API.", "main": "./src/app.js", "scripts": { From 4e3ec3e6913fd85f73d90ce2b990ff0c62d4a716 Mon Sep 17 00:00:00 2001 From: xjuanfxx <126913334+xjuanfxx@users.noreply.github.com> Date: Sat, 4 Mar 2023 22:34:32 -0800 Subject: [PATCH 3/5] Update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 10695485..d165d8a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "discord-tts-bot", - "version": "4.1.1", + "version": "4.1.2", "lockfileVersion": 2, "requires": true, "packages": { From fc5ff81706d7c9eb4ebb3ac0f0867845b75ff94b Mon Sep 17 00:00:00 2001 From: xjuanfxx <126913334+xjuanfxx@users.noreply.github.com> Date: Sat, 4 Mar 2023 22:35:00 -0800 Subject: [PATCH 4/5] Update VoiceManager.js --- src/classes/VoiceManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/VoiceManager.js b/src/classes/VoiceManager.js index 1949e125..bbd47a85 100644 --- a/src/classes/VoiceManager.js +++ b/src/classes/VoiceManager.js @@ -28,8 +28,8 @@ class VoiceManager { selfDeaf: false, selfMute: false }); - connection.on('stateChange', (old_state, new_state) => { - if (old_state.status === VoiceConnectionStatus.Ready && new_state.status === VoiceConnectionStatus.Connecting) { + connection.on('stateChange', (oldState, newState) => { + if (oldState.status === VoiceConnectionStatus.Ready && newState.status === VoiceConnectionStatus.Connecting) { connection.configureNetworking(); } }); From ae009feb998fd0ff984caa609606f5f3b8700f31 Mon Sep 17 00:00:00 2001 From: xjuanfxx <126913334+xjuanfxx@users.noreply.github.com> Date: Sat, 4 Mar 2023 22:44:27 -0800 Subject: [PATCH 5/5] Update VoiceManager.js --- src/classes/VoiceManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/VoiceManager.js b/src/classes/VoiceManager.js index bbd47a85..4b2b59df 100644 --- a/src/classes/VoiceManager.js +++ b/src/classes/VoiceManager.js @@ -30,9 +30,9 @@ class VoiceManager { }); connection.on('stateChange', (oldState, newState) => { if (oldState.status === VoiceConnectionStatus.Ready && newState.status === VoiceConnectionStatus.Connecting) { - connection.configureNetworking(); + connection.configureNetworking(); } - }); + }); // Resolve this voice manager once the connection is ready. connection.on(VoiceConnectionStatus.Ready, () => { connection.subscribe(this.player);