From 0324f5ba6a547242dde7543dacc60e069d767cec Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Sun, 17 Oct 2021 14:38:11 +0530 Subject: Add incidents check in delete and reaction handlers also --- bot/exts/moderation/incidents.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py index a02a38b24..92b4fd5cf 100644 --- a/bot/exts/moderation/incidents.py +++ b/bot/exts/moderation/incidents.py @@ -459,8 +459,9 @@ class Incidents(Cog): else: log.trace("Deletion was confirmed") - # Deletes the message link embeds found in cache from the channel and cache. - await self.delete_msg_link_embed(incident.id) + if self.incidents_webhook: + # Deletes the message link embeds found in cache from the channel and cache. + await self.delete_msg_link_embed(incident.id) async def resolve_message(self, message_id: int) -> Optional[discord.Message]: """ @@ -567,7 +568,8 @@ class Incidents(Cog): Search through the cache for message, if found delete it from cache and channel. """ - await self.delete_msg_link_embed(payload.message_id) + if self.incidents_webhook: + await self.delete_msg_link_embed(payload.message_id) async def extract_message_links(self, message: discord.Message) -> Optional[list[discord.Embed]]: """ -- cgit v1.2.3