aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-10-12 06:49:52 +0530
committerGravatar Shivansh-007 <[email protected]>2021-10-12 06:51:54 +0530
commit9da71eddbf5641f2aa734a2fbe67fc444d390856 (patch)
tree436a083081d8b32bcf0221c7a9d32f082eaa612b
parentUpdate typehints (diff)
Use scheduling create_task util instead of creating from loop directly
-rw-r--r--bot/exts/moderation/incidents.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 5c1554861..65dc69ca6 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -296,7 +296,7 @@ class Incidents(Cog):
"""Prepare `event_lock` and schedule `crawl_task` on start-up."""
self.bot = bot
- self.bot.loop.create_task(self.fetch_webhook())
+ scheduling.create_task(self.fetch_webhook(), event_loop=self.bot.loop)
self.event_lock = asyncio.Lock()
self.crawl_task = scheduling.create_task(self.crawl_incidents(), event_loop=self.bot.loop)
@@ -554,7 +554,9 @@ class Incidents(Cog):
return
await add_signals(message)
- if embed_list := await self.extract_message_links(message):
+
+ # Only use this feature if incidents webhook embed is found
+ if embed_list := await self.extract_message_links(message) and self.incidents_webhook:
await self.send_message_link_embeds(embed_list, message, self.incidents_webhook)
@Cog.listener()