From 6c7444d6f61fe201f97673de435a63d4b4f67c7d Mon Sep 17 00:00:00 2001 From: minalike Date: Tue, 22 Feb 2022 20:08:29 -0500 Subject: 🐛 Fix to correctly calculate number of seconds from last notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit total_seconds() is the correct method to obtain a time delta in seconds --- bot/exts/help_channels/_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py index 6e986282e..0aabb9bfb 100644 --- a/bot/exts/help_channels/_message.py +++ b/bot/exts/help_channels/_message.py @@ -139,7 +139,7 @@ async def notify_none_remaining(last_notification: Arrow) -> t.Optional[Arrow]: if not constants.HelpChannels.notify_none_remaining: return None - if (arrow.utcnow() - last_notification).seconds < (constants.HelpChannels.notify_minutes * 60): + if (arrow.utcnow() - last_notification).total_seconds() < (constants.HelpChannels.notify_minutes * 60): log.trace("Did not send none_remaining notification as it hasn't been enough time since the last one.") return None @@ -188,7 +188,7 @@ async def notify_running_low(number_of_channels_left: int, last_notification: Ar log.trace("Did not send notify_running_low notification as the threshold was not met.") return None - if (arrow.utcnow() - last_notification).seconds < (constants.HelpChannels.notify_minutes * 60): + if (arrow.utcnow() - last_notification).total_seconds() < (constants.HelpChannels.notify_minutes * 60): log.trace("Did not send notify_running_low notification as it hasn't been enough time since the last one.") return None -- cgit v1.2.3