diff options
| -rw-r--r-- | bot/cogs/help_channels.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 9ef7fc72c..b4121c7fd 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -12,6 +12,7 @@ from discord.ext import commands from bot import constants from bot.bot import Bot +from bot.decorators import with_role from bot.utils.scheduling import Scheduler log = logging.getLogger(__name__) @@ -117,8 +118,14 @@ class HelpChannels(Scheduler, commands.Cog): return deque(available_names) @commands.command(name="dormant") - async def dormant_command(self) -> None: + @with_role(*constants.HelpChannels.cmd_whitelist) + async def dormant_command(self, ctx: commands.Context) -> None: """Make the current in-use help channel dormant.""" + in_use = self.get_category_channels(self.in_use_category) + if ctx.channel in in_use: + await self.move_to_dormant(ctx.channel) + else: + log.debug(f"{ctx.author} invoked command 'dormant' outside an in-use help channel") async def get_available_candidate(self) -> discord.TextChannel: """ |