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;