From b48aa8d125347f175b964a7ca089662d9dd6b8b5 Mon Sep 17 00:00:00 2001 From: Histmy Date: Thu, 28 Jan 2021 10:49:17 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20bot=20crashing=20after=20him=20leaving?= =?UTF-8?q?=20voice=20and=20somebody=20odposlouch=C3=A1vat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app.js b/app.js index 9267c49..ff41136 100644 --- a/app.js +++ b/app.js @@ -48,6 +48,7 @@ client.on('presenceUpdate', (bef, aft) => { client.on('voiceStateUpdate', (bef, aft) => { if (!aft.channel || !aft.guild.voice || aft.member.user === client.user) return; + if (!aft.guild.voice.connection) return; if (aft.mute && !aft.deaf) { const disp = aft.guild.voice.connection.play('./zvuky/neodposlouchavej.ogg'); disp.on('finish', () => aft.setDeaf(true, 'otposlouchávala ta gadza'));