From 78e2c1c3cf84a0278c908bfddf556da9e79cda44 Mon Sep 17 00:00:00 2001 From: Elitex Date: Wed, 13 Sep 2023 21:24:17 +0530 Subject: [PATCH] Manual Disconnect Player Bug Resolved --- build/structures/Connection.js | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build/structures/Connection.js b/build/structures/Connection.js index f2370d6..1356d3b 100644 --- a/build/structures/Connection.js +++ b/build/structures/Connection.js @@ -39,6 +39,12 @@ class Connection { setStateUpdate(data) { const { session_id, channel_id, self_deaf, self_mute } = data; + // If player is manually disconnected from VC + if(channel_id == null) { + this.player.destroy(); + this.player.emit("playerDestroy", this.player); + } + if (this.player.voiceChannel && channel_id && this.player.voiceChannel !== channel_id) { this.player.emit("playerMove", this.player.voiceChannel, channel_id) this.player.voiceChannel = channel_id; diff --git a/package.json b/package.json index c3352c6..5cf9b22 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "riffy", "description": "Riffy is a pro lavalink client. It is designed to be simple and easy to use, with a focus on stability and more features.", - "version": "1.0.0", + "version": "1.0.1", "main": "build/index.js", "types": "build/index.d.ts", "files": [