Removed neodposlouchavej when bot out off voice...

that didn't even work
This commit is contained in:
Histmy 2021-04-13 15:29:04 +02:00
parent 749743e32d
commit 0f5f94ef99

View File

@ -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;