aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-10-19 13:08:29 -0700
committerGravatar MarkKoz <[email protected]>2020-11-20 15:57:09 -0800
commit9debf8d649e0f63753f0f486cd8b7490d90c324c (patch)
tree4ea54e24e78771ec3ad68d5b85b39ea865c15272
parentHelp channels: replace ready event with awaiting the init task (diff)
Help channels: wait for cog to be ready in deleted msg listener
-rw-r--r--bot/exts/help_channels/_cog.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py
index bea1f65e6..29570bab3 100644
--- a/bot/exts/help_channels/_cog.py
+++ b/bot/exts/help_channels/_cog.py
@@ -488,6 +488,10 @@ class HelpChannels(commands.Cog):
if not await _message.is_empty(msg.channel):
return
+ if not self.init_task.done():
+ log.trace("Waiting for the cog to be ready before processing deleted messages.")
+ await self.init_task
+
log.info(f"Claimant of #{msg.channel} ({msg.author}) deleted message, channel is empty now. Rescheduling task.")
# Cancel existing dormant task before scheduling new.