diff options
| author | 2020-02-27 20:16:30 -0800 | |
|---|---|---|
| committer | 2020-03-22 15:54:39 -0700 | |
| commit | 9597921a8a11e3e915e5fe49e7a1ace46a81b98f (patch) | |
| tree | 0f925a1d49b5e8d19580c166e8c827197110a4bf | |
| parent | HelpChannels: warn if too many help channels will be possible (diff) | |
HelpChannels: sort dormant channels alphabetically
The channels are easier to find when sorted alphabetically.
* Merge some trace and info logs
| -rw-r--r-- | bot/cogs/help_channels.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 64443f81c..0f700a9ba 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -373,13 +373,16 @@ class HelpChannels(Scheduler, commands.Cog): async def move_to_dormant(self, channel: discord.TextChannel) -> None: """Make the `channel` dormant.""" - log.info(f"Making #{channel.name} ({channel.id}) dormant.") + log.info(f"Moving #{channel.name} ({channel.id}) to the Dormant category.") + + start_index = len(constants.HelpChannels.name_prefix) + element = channel.name[start_index:] - log.trace(f"Moving #{channel.name} ({channel.id}) to the Dormant category.") await channel.edit( category=self.dormant_category, sync_permissions=True, topic=DORMANT_TOPIC, + position=self.elements[element], ) log.trace(f"Sending dormant message for #{channel.name} ({channel.id}).") @@ -391,9 +394,8 @@ class HelpChannels(Scheduler, commands.Cog): async def move_to_in_use(self, channel: discord.TextChannel) -> None: """Make a channel in-use and schedule it to be made dormant.""" - log.info(f"Making #{channel.name} ({channel.id}) in-use.") + log.info(f"Moving #{channel.name} ({channel.id}) to the In Use category.") - log.trace(f"Moving #{channel.name} ({channel.id}) to the In Use category.") await channel.edit( category=self.in_use_category, sync_permissions=True, |