mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-05-04 12:32:59 +12:00
fix bug with inital setting of channel pos
This commit is contained in:
parent
0472fec4f3
commit
81f9769f88
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue