diff options
| author | 2020-02-24 15:57:28 -0800 | |
|---|---|---|
| committer | 2020-03-22 15:54:36 -0700 | |
| commit | 24bdb303547f7d03eaa7ed8cd7720e5cc0c91e8b (patch) | |
| tree | f5f910fa879e9ad374c8ec85daba3cf9f68d5e72 | |
| parent | HelpChannels: implement get_available_candidate (diff) | |
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
| -rw-r--r-- | bot/cogs/help_channels.py | 14 |
1 files changed, 14 insertions, 0 deletions
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.""" |