From 24bdb303547f7d03eaa7ed8cd7720e5cc0c91e8b Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Mon, 24 Feb 2020 15:57:28 -0800 Subject: HelpChannels: implement move_to_available Moves a channel to the Available category. Permissions will be synced with the new category. * Add stubs for channel topic constants --- bot/cogs/help_channels.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 99815d4e5..5e27757f7 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -16,6 +16,10 @@ from bot.utils.scheduling import Scheduler log = logging.getLogger(__name__) +# TODO: write the channel topics +AVAILABLE_TOPIC = "" +IN_USE_TOPIC = "" +DORMANT_TOPIC = "" ASKING_GUIDE_URL = "https://pythondiscord.com/pages/asking-good-questions/" AVAILABLE_MSG = f""" @@ -216,6 +220,16 @@ class HelpChannels(Scheduler, commands.Cog): async def move_to_available(self) -> None: """Make a channel available.""" + channel = await self.get_available_candidate() + embed = discord.Embed(description=AVAILABLE_MSG) + + # TODO: edit or delete the dormant message + await channel.send(embed=embed) + await channel.edit( + category=self.available_category, + sync_permissions=True, + topic=AVAILABLE_TOPIC, + ) async def move_to_dormant(self, channel: discord.TextChannel) -> None: """Make the `channel` dormant.""" -- cgit v1.2.3