From 5dc2774e0f80a934b650a972373330885591f45c Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Thu, 2 Mar 2023 22:10:25 +0500 Subject: [PATCH] v5.3.12 Temporary fix for voice connection issues --- package.json | 2 +- src/VoiceInterface/StreamDispatcher.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3422176..693a8ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-player-play-dl", - "version": "5.3.11", + "version": "5.3.12", "description": "Complete framework to facilitate music commands using discord.js and play-dl", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/VoiceInterface/StreamDispatcher.ts b/src/VoiceInterface/StreamDispatcher.ts index d6575e0..b350322 100644 --- a/src/VoiceInterface/StreamDispatcher.ts +++ b/src/VoiceInterface/StreamDispatcher.ts @@ -68,7 +68,11 @@ class StreamDispatcher extends EventEmitter { */ this.paused = false; - this.voiceConnection.on("stateChange", async (_, newState) => { + this.voiceConnection.on("stateChange", async (oldState, newState) => { + if (oldState.status === VoiceConnectionStatus.Ready && newState.status === VoiceConnectionStatus.Connecting) { + connection.configureNetworking(); // Temp fix for 1 minute disconnect + } + if (newState.status === VoiceConnectionStatus.Disconnected) { if (newState.reason === VoiceConnectionDisconnectReason.WebSocketClose && newState.closeCode === 4014) { try {