aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/help_channels/_stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/help_channels/_stats.py')
-rw-r--r--bot/exts/help_channels/_stats.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/bot/exts/help_channels/_stats.py b/bot/exts/help_channels/_stats.py
index b8778e7d9..eb34e75e1 100644
--- a/bot/exts/help_channels/_stats.py
+++ b/bot/exts/help_channels/_stats.py
@@ -22,21 +22,20 @@ def report_counts() -> None:
log.warning(f"Couldn't find category {name!r} to track channel count stats.")
-async def report_complete_session(channel_id: int, is_auto: bool) -> None:
+async def report_complete_session(channel_id: int, closed_on: _channel.ClosingReason) -> None:
"""
Report stats for a completed help session channel `channel_id`.
- Set `is_auto` to True if the channel was automatically closed or False if manually closed.
+ `closed_on` is the reason why the channel was closed. See `_channel.ClosingReason` for possible reasons.
"""
- caller = "auto" if is_auto else "command"
- bot.instance.stats.incr(f"help.dormant_calls.{caller}")
+ bot.instance.stats.incr(f"help.dormant_calls.{closed_on.value}")
in_use_time = await _channel.get_in_use_time(channel_id)
if in_use_time:
bot.instance.stats.timing("help.in_use_time", in_use_time)
- unanswered = await _caches.unanswered.get(channel_id)
- if unanswered:
+ non_claimant_last_message_time = await _caches.non_claimant_last_message_times.get(channel_id)
+ if non_claimant_last_message_time is None:
bot.instance.stats.incr("help.sessions.unanswered")
- elif unanswered is not None:
+ else:
bot.instance.stats.incr("help.sessions.answered")