Skip to content

Commit

Permalink
Merge pull request #89 from xjuanfxx/master
Browse files Browse the repository at this point in the history
Solution to voice disconnection
  • Loading branch information
moonstar-x authored Mar 5, 2023
2 parents ca465d8 + ae009fe commit 57937ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 5 additions & 1 deletion src/classes/VoiceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class VoiceManager {
selfDeaf: false,
selfMute: false
});

connection.on('stateChange', (oldState, newState) => {
if (oldState.status === VoiceConnectionStatus.Ready && newState.status === VoiceConnectionStatus.Connecting) {
connection.configureNetworking();
}
});
// Resolve this voice manager once the connection is ready.
connection.on(VoiceConnectionStatus.Ready, () => {
connection.subscribe(this.player);
Expand Down

0 comments on commit 57937ab

Please sign in to comment.