diff options
author | 2021-03-26 21:57:59 +0000 | |
---|---|---|
committer | 2021-03-26 21:57:59 +0000 | |
commit | a732e0a412e72233af98b4954c2fa001a06bd8c7 (patch) | |
tree | 3b4b535594c770498e3775f63994f06225cc2f0a | |
parent | Add 1 second due to POSIX timestamps being lower resolution than datetime obj... (diff) |
Use correct constant for each type of help session user
-rw-r--r-- | bot/exts/help_channels/_channel.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index 5845e7087..d46969d4f 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -32,9 +32,9 @@ async def get_closing_time(channel: discord.TextChannel, init_done: bool) -> t.T is_empty = await _message.is_empty(channel) if is_empty: - idle_minutes = constants.HelpChannels.deleted_idle_minutes + idle_minutes_claimant = constants.HelpChannels.deleted_idle_minutes else: - idle_minutes = constants.HelpChannels.idle_minutes_claimant + idle_minutes_claimant = constants.HelpChannels.idle_minutes_claimant claimant_last_message_time = await _caches.claimant_last_message_times.get(channel.id) @@ -54,7 +54,7 @@ async def get_closing_time(channel: discord.TextChannel, init_done: bool) -> t.T return datetime.min, "deleted" # The time at which a channel should be closed. - return msg.created_at + timedelta(minutes=idle_minutes), "latest_message" + return msg.created_at + timedelta(minutes=idle_minutes_claimant), "latest_message" # Switch to datetime objects so we can use time deltas claimant_last_message_time = datetime.utcfromtimestamp(claimant_last_message_time) @@ -68,8 +68,8 @@ async def get_closing_time(channel: discord.TextChannel, init_done: bool) -> t.T non_claimant_last_message_time = datetime.min # Get the later time at which a channel should be closed - non_claimant_last_message_time += timedelta(minutes=idle_minutes) - claimant_last_message_time += timedelta(minutes=constants.HelpChannels.idle_minutes_claimant) + non_claimant_last_message_time += timedelta(minutes=constants.HelpChannels.idle_minutes_others) + claimant_last_message_time += timedelta(minutes=idle_minutes_claimant) # The further away closing time is what we should use. if claimant_last_message_time >= non_claimant_last_message_time: |