From 91eecb4b0be3ef1574cca0302b900fec70c95ebd Mon Sep 17 00:00:00 2001 From: profitroll Date: Tue, 2 May 2023 16:13:11 +0200 Subject: [PATCH] Fixed channels logic --- cogs/cogChannel.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cogs/cogChannel.py b/cogs/cogChannel.py index afa516c..1df78c1 100644 --- a/cogs/cogChannel.py +++ b/cogs/cogChannel.py @@ -40,26 +40,18 @@ 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 after.channel is None and before.channel.category == category and len(before.channel.members) == 0: + if before.channel is not None and len(before.channel.members) == 0: if isUserVoice(vc_from): if isVoiceOfUser(vc_from, member): await removeUserVoice(vc_from) - return else: if loadJson("config.json")["enable_nomic"]: await changeNomicPerms("deny", vc_from, member) # If user joined vc 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) - else: - if loadJson("config.json")["enable_nomic"]: - await changeNomicPerms("deny", vc_from, member) if isUserVoice(vc_to): if loadJson("config.json")["enable_nomic"]: await changeNomicPerms("allow", vc_to, member)