From 1cd39355b48feef827d8d2a56181aed1140b2e1e Mon Sep 17 00:00:00 2001 From: git-bruh Date: Sun, 13 Dec 2020 12:25:39 +0530 Subject: [PATCH] Handle exception if webhook message is already deleted on Discord --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index 123ea3f..19e2e4f 100644 --- a/main.py +++ b/main.py @@ -327,6 +327,9 @@ class Callbacks(object): try: message = message_store[event.redacts] await message.delete() + except discord.errors.NotFound as e: + matrix_logger.warning( + f"Failed to delete message {event.event_id}: {e}") except KeyError: pass