aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar GDWR <[email protected]>2022-02-01 00:30:05 +0000
committerGravatar GDWR <[email protected]>2022-02-01 00:30:05 +0000
commit9fa586a85f3e9707e13fa19919d1c8519227f087 (patch)
tree87aba020882c1b9c55092776456bbad86c836063
parent✨ Notify running low on channels (diff)
🚨 Linting fixes
-rw-r--r--bot/exts/help_channels/_cog.py8
-rw-r--r--bot/exts/help_channels/_message.py4
2 files changed, 8 insertions, 4 deletions
diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py
index 85799516c..5dfb09b64 100644
--- a/bot/exts/help_channels/_cog.py
+++ b/bot/exts/help_channels/_cog.py
@@ -233,9 +233,13 @@ class HelpChannels(commands.Cog):
try:
channel = self.channel_queue.get_nowait()
- within_interval = (arrow.utcnow() - self.last_running_low_notification).seconds >= self.notify_interval_seconds
+ time_since_last_notify_seconds = (arrow.utcnow() - self.last_running_low_notification).seconds
+ within_interval = time_since_last_notify_seconds >= self.notify_interval_seconds
if within_interval and self.channel_queue.qsize() <= constants.HelpChannels.notify_running_low_threshold:
- await _message.notify_running_low(self.bot.get_channel(constants.HelpChannels.notify_channel), self.channel_queue.qsize())
+ await _message.notify_running_low(
+ self.bot.get_channel(constants.HelpChannels.notify_channel),
+ self.channel_queue.qsize()
+ )
self.last_running_low_notification = arrow.utcnow()
except asyncio.QueueEmpty:
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py
index d53a03b77..7d70c9f00 100644
--- a/bot/exts/help_channels/_message.py
+++ b/bot/exts/help_channels/_message.py
@@ -1,7 +1,6 @@
import textwrap
import typing as t
-import arrow
import discord
from arrow import Arrow
@@ -158,7 +157,8 @@ async def notify_none_remaining(channel: discord.TextChannel) -> None:
async def notify_running_low(channel: discord.TextChannel, number_of_channels_left: int) -> None:
"""
Send a non-pinging message in `channel` notifying about there being a low amount of dormant channels.
- Including the amount of channels left in dormant.
+
+ This will include the number of dormant channels left `number_of_channels_left`
Configuration:
* `HelpChannels.notify_minutes` - minimum interval between notifications