diff options
| author | 2020-02-24 14:45:06 -0800 | |
|---|---|---|
| committer | 2020-03-22 15:54:35 -0700 | |
| commit | 7c4b776847e7c857c09d43a2434d1187bbb354b5 (patch) | |
| tree | 5c84fc78a744cd5c268114539f0392d71e13d2f9 | |
| parent | Constants: implement init_available (diff) | |
Constants: add a named tuple for scheduled task data
| -rw-r--r-- | bot/cogs/help_channels.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 06520fc08..c440d166c 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -43,6 +43,13 @@ with Path("bot/resources/elements.json").open(encoding="utf-8") as elements_file ELEMENTS = json.load(elements_file) +class ChannelTimeout(t.NamedTuple): + """Data for a task scheduled to make a channel dormant.""" + + channel: discord.TextChannel + timeout: int + + class HelpChannels(Scheduler, commands.Cog): """Manage the help channel system of the guild.""" @@ -175,8 +182,8 @@ class HelpChannels(Scheduler, commands.Cog): return channel - async def _scheduled_task(self, channel: discord.TextChannel, timeout: int) -> None: - """Make the `channel` dormant after `timeout` seconds or reschedule if it's still active.""" + async def _scheduled_task(self, data: ChannelTimeout) -> None: + """Make a channel dormant after specified timeout or reschedule if it's still active.""" def setup(bot: Bot) -> None: |