aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh <[email protected]>2021-05-12 09:35:40 +0530
committerGravatar Shivansh-007 <[email protected]>2021-10-11 12:05:43 +0530
commit682693bc07960db186cef95b0188031f934a360c (patch)
tree6459769c0b26340a213abeb4bd704365bd00e45b
parentMake `extract_message_links` an instance method (diff)
Delete msg link embed if no link on edit
Earlier, if we edited a message which contained message links originally but not now, then the webhook message wouldn't get deleted. This commits fixes that bug.
-rw-r--r--bot/exts/moderation/incidents.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 197842034..7aad1df35 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -537,6 +537,10 @@ class Incidents(Cog):
webhook_embed_list = await self.extract_message_links(msg_after)
webhook_msg_id = await self.message_link_embeds_cache.get(msg_before.id)
+ if not webhook_embed_list:
+ await self.delete_msg_link_embed(msg_after)
+ return
+
if webhook_msg_id:
await self.incidents_webhook.edit_message(
message_id=webhook_msg_id,