From 81f9769f88b8607569d0f54e9f1c5a9959e2fe48 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 15 Nov 2022 17:02:01 -0500 Subject: [PATCH] fix bug with inital setting of channel pos --- channelcontrol/channelcontrol.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/channelcontrol/channelcontrol.py b/channelcontrol/channelcontrol.py index 6f61341..05e5790 100644 --- a/channelcontrol/channelcontrol.py +++ b/channelcontrol/channelcontrol.py @@ -54,14 +54,12 @@ class ChannelControl(commands.Cog): # update channel positions for new channels for guild in self.bot.guilds: locked = await self.config.guild(guild).locked() - if not locked: - continue all_channels = guild.text_channels + guild.voice_channels for channel in all_channels: curr = await self.config.channel(channel).pos() if curr == -1: await self.config.channel(channel).pos.set(channel.position) - elif curr != channel.position: + elif curr != channel.position and locked: # channel moved while bot was down, need to fix try: await channel.edit(position=curr)