Handle exception if edited message is deleted on Discord

This commit is contained in:
git-bruh 2020-12-14 15:57:08 +05:30
parent 6e869e724c
commit ed6562233b
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -288,7 +288,14 @@ class Callbacks(object):
content_dict["m.new_content"]["body"], channel_id content_dict["m.new_content"]["body"], channel_id
) )
webhook_message = message_store[edited_event] webhook_message = message_store[edited_event]
try:
await webhook_message.edit(content=edited_content) await webhook_message.edit(content=edited_content)
except discord.errors.NotFound as e:
matrix_logger.warning(
f"Failed to edit message {edited_event}: {e}"
)
return return
except KeyError: except KeyError:
pass pass