aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-10-17 14:33:21 +0530
committerGravatar Shivansh-007 <[email protected]>2021-10-17 14:33:21 +0530
commit50d1cd96623f4d6423326b23e590f9378e69c14c (patch)
treea9576b22b880e0829d90bf2f534f905da3626ad2
parentUse scheduling create_task util instead of creating from loop directly (diff)
Check for webhook availability before extracting msg links
-rw-r--r--bot/exts/moderation/incidents.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 65dc69ca6..a02a38b24 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -556,8 +556,9 @@ class Incidents(Cog):
await add_signals(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)
+ if self.incidents_webhook:
+ if embed_list := await self.extract_message_links(message):
+ await self.send_message_link_embeds(embed_list, message, self.incidents_webhook)
@Cog.listener()
async def on_raw_message_delete(self, payload: discord.RawMessageDeleteEvent) -> None:
@@ -608,7 +609,7 @@ class Incidents(Cog):
Using the `webhook` passed in as a parameter to send
the embeds in the `webhook_embed_list` parameter.
- After sending each embed it maps the `message.id
+ After sending each embed it maps the `message.id`
to the `webhook_msg_ids` IDs in the async redis-cache.
"""
try: