From 07e45ae54da0908710bcd927785996411631b976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 4 Aug 2021 14:47:27 +0300 Subject: [PATCH] Updated voiceStateUpdate --- src/client/events/voiceStateUpdate.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/events/voiceStateUpdate.js b/src/client/events/voiceStateUpdate.js index b4b60d6..ed8046b 100644 --- a/src/client/events/voiceStateUpdate.js +++ b/src/client/events/voiceStateUpdate.js @@ -1,3 +1,8 @@ +const { + getVoiceConnection, + joinVoiceChannel +} = require("@discordjs/voice"); + module.exports = { name: "voiceStateUpdate", async execute(client, oldState, newState) { @@ -9,6 +14,7 @@ module.exports = { if (newState.member.id === client.user.id && oldState.member.id === client.user.id) { if (newState.channel === null) { client.funcs.statisticsUpdate(client, newState.guild, radio); + radio.audioPlayer.stop(); return client.radio.delete(newState.guild.id); }