diff options
| author | 2020-10-19 13:08:29 -0700 | |
|---|---|---|
| committer | 2020-11-20 15:57:09 -0800 | |
| commit | 9debf8d649e0f63753f0f486cd8b7490d90c324c (patch) | |
| tree | 4ea54e24e78771ec3ad68d5b85b39ea865c15272 | |
| parent | Help 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.py | 4 |
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. |