diff options
author | 2021-10-17 14:38:11 +0530 | |
---|---|---|
committer | 2021-10-17 14:38:11 +0530 | |
commit | 0324f5ba6a547242dde7543dacc60e069d767cec (patch) | |
tree | aac307ea44c65a728b5524d5772dafbf12106e52 | |
parent | Check for webhook availability before extracting msg links (diff) |
Add incidents check in delete and reaction handlers also
-rw-r--r-- | bot/exts/moderation/incidents.py | 8 |
1 files 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]]: """ |