aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris <[email protected]>2021-03-18 21:19:34 +0000
committerGravatar Chris <[email protected]>2021-03-18 21:19:34 +0000
commit3fe9a39a3d262f32bc5dc8d18de5075aad8b0e5c (patch)
tree2cd4b8852c564fc072cdbbc073b334af3235a3ab
parentIf the channel is empty, determine closing time based on last message. (diff)
Determine closing time from last message if either cache is empty, rather than if both are empty
-rw-r--r--bot/exts/help_channels/_channel.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py
index 454e41157..c65b87986 100644
--- a/bot/exts/help_channels/_channel.py
+++ b/bot/exts/help_channels/_channel.py
@@ -26,7 +26,7 @@ def get_category_channels(category: discord.CategoryChannel) -> t.Iterable[disco
async def get_closing_time(channel: discord.TextChannel) -> datetime:
- """Return the timestamp at which the given help channel, `channel`, should be closed."""
+ """Return the timestamp at which the given help `channel` should be closed."""
log.trace(f"Getting the closing time for #{channel} ({channel.id}).")
if is_empty := await _message.is_empty(channel):
@@ -37,7 +37,7 @@ async def get_closing_time(channel: discord.TextChannel) -> datetime:
non_claimant_last_message_time = await _caches.non_claimant_last_message_times.get(channel.id)
claimant_last_message_time = await _caches.claimant_last_message_times.get(channel.id)
- if is_empty or not (non_claimant_last_message_time or claimant_last_message_time):
+ if is_empty or not (non_claimant_last_message_time and claimant_last_message_time):
# Current help session has no messages, or one of the caches is empty.
# Use the last message in the channel to determine closing time instead.
msg = await _message.get_last_message(channel)