aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2021-02-13 17:34:57 +0200
committerGravatar mbaruh <[email protected]>2021-02-13 17:34:57 +0200
commit94f7a701034d53e82d04f2a08e5927f874c74f49 (patch)
tree5cbca60f0f0179e861962e74b79c206478d15bbd
parentStatus command displays verification level (diff)
Prevent channel description edit from locking commands
Because some parts are defined as atomic transaction, we can't use them with channel description edits which are heavily rate limited. Description edits are now run in a separate task.
-rw-r--r--bot/exts/moderation/defcon.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/moderation/defcon.py b/bot/exts/moderation/defcon.py
index 17b521b00..d1b99cb35 100644
--- a/bot/exts/moderation/defcon.py
+++ b/bot/exts/moderation/defcon.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import asyncio
import logging
from collections import namedtuple
from datetime import datetime
@@ -182,7 +183,7 @@ class Defcon(Cog):
new_topic = f"{BASE_CHANNEL_TOPIC}\n(Threshold: {humanize_delta(self.threshold)})"
self.mod_log.ignore(Event.guild_channel_update, Channels.defcon)
- await self.channel.edit(topic=new_topic)
+ asyncio.create_task(self.channel.edit(topic=new_topic))
@redis_cache.atomic_transaction
async def _defcon_action(self, author: User, threshold: relativedelta, expiry: Optional[Expiry] = None) -> None: