From 0f5f94ef9964851d69ee87853527c45a5d9e98c9 Mon Sep 17 00:00:00 2001 From: Histmy Date: Tue, 13 Apr 2021 15:29:04 +0200 Subject: [PATCH] Removed neodposlouchavej when bot out off voice... that didn't even work --- modules/vojs.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/vojs.js b/modules/vojs.js index 7d0814d..64b7842 100644 --- a/modules/vojs.js +++ b/modules/vojs.js @@ -143,14 +143,11 @@ module.exports = { // Neodposlouchávej on_voiceStateUpdate: (bef, aft) => { - if (!aft.channel || !aft.guild.voice || aft.member.user === aft.guild.client.user) return; + if (!aft.channel || !aft.guild.voice?.connection || aft.member.user === aft.guild.client.user) return; if (aft.selfMute && !aft.deaf) { - if (!aft.guild.voice.connection) aft.setDeaf(true, 'otposlouchávala ta gadza'); - else { - aft.guild.voice.connection.play('./zvuky/neodposlouchavej.ogg', { volume: 0.38 }) - .on('finish', () => { if (aft.selfMute) aft.setDeaf(true, 'otposlouchávala ta gadza') }); - } + aft.guild.voice.connection.play('./zvuky/neodposlouchavej.ogg', { volume: 0.38 }) + .on('finish', () => { if (aft.selfMute) aft.setDeaf(true, 'otposlouchávala ta gadza') }); } if (!bef.channel) return;