diff options
| author | 2020-06-21 09:30:47 +0300 | |
|---|---|---|
| committer | 2020-06-21 09:30:47 +0300 | |
| commit | f4004d814c1babfb5906afb8cd9944ceef90a2a3 (patch) | |
| tree | 5db18837895651a2579f7806e9ca2a08161383e2 | |
| parent | Reddit: Don't define revoke task as variable but instantly append (diff) | |
Silence: Add mod alert sending to `closing_tasks` to avoid error
| -rw-r--r-- | bot/cogs/moderation/silence.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/moderation/silence.py b/bot/cogs/moderation/silence.py index c8ab6443b..34baa2bcb 100644 --- a/bot/cogs/moderation/silence.py +++ b/bot/cogs/moderation/silence.py @@ -176,7 +176,7 @@ class Silence(Scheduler, commands.Cog): if self.muted_channels: channels_string = ''.join(channel.mention for channel in self.muted_channels) message = f"<@&{Roles.moderators}> channels left silenced on cog unload: {channels_string}" - asyncio.create_task(self._mod_alerts_channel.send(message)) + self.bot.closing_tasks.append(asyncio.create_task(self._mod_alerts_channel.send(message))) # This cannot be static (must have a __func__ attribute). def cog_check(self, ctx: Context) -> bool: |