aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-04-01 17:00:57 +0200
committerGravatar GitHub <[email protected]>2021-04-01 17:00:57 +0200
commit351ed5a269c3343a8e8f2df2f12929492db280e1 (patch)
treedcd8a4d281a54ddaa03e5e4edeb8b246ba65012e
parentMerge pull request #1494 from python-discord/policy-documents (diff)
parentMerge branch 'main' into fix-delete-closing-reason-stat (diff)
Merge pull request #1492 from python-discord/fix-delete-closing-reason-stat
Use deleted reason if help channel is closed due to being empty
-rw-r--r--bot/exts/help_channels/_channel.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py
index 2837bc7c5..0846b28c8 100644
--- a/bot/exts/help_channels/_channel.py
+++ b/bot/exts/help_channels/_channel.py
@@ -75,7 +75,8 @@ async def get_closing_time(channel: discord.TextChannel, init_done: bool) -> t.T
# Use the greatest offset to avoid the possibility of prematurely closing the channel.
time = Arrow.fromdatetime(msg.created_at) + timedelta(minutes=idle_minutes_claimant)
- return time, ClosingReason.LATEST_MESSSAGE
+ reason = ClosingReason.DELETED if is_empty else ClosingReason.LATEST_MESSSAGE
+ return time, reason
claimant_time = Arrow.utcfromtimestamp(claimant_time)
others_time = await _caches.non_claimant_last_message_times.get(channel.id)