From 301439f14462269f8da078d9d004dec24407a72c Mon Sep 17 00:00:00 2001 From: profitroll Date: Tue, 2 May 2023 15:09:23 +0200 Subject: [PATCH] Fixed bot trigger on deafen and mute --- cogs/cogChannel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/cogChannel.py b/cogs/cogChannel.py index 170fffe..afa516c 100644 --- a/cogs/cogChannel.py +++ b/cogs/cogChannel.py @@ -40,9 +40,10 @@ class CogChannel(commands.Cog): vc_from = before.channel vc_to = after.channel + category = member.guild.get_channel(guildConfGet(member.guild, "category")) # If user left vc - if vc_to is None: + if after.channel is None and before.channel.category == category and len(before.channel.members) == 0: if isUserVoice(vc_from): if isVoiceOfUser(vc_from, member): await removeUserVoice(vc_from) @@ -52,7 +53,7 @@ class CogChannel(commands.Cog): await changeNomicPerms("deny", vc_from, member) # If user joined vc - else: + if after.channel is not None and after.channel.id == guildConfGet(member.guild, "channel"): if isUserVoice(vc_from): if isVoiceOfUser(vc_from, member): await removeUserVoice(vc_from)