Handle exception if edited message is deleted on Discord
This commit is contained in:
parent
6e869e724c
commit
ed6562233b
1 changed files with 8 additions and 1 deletions
9
main.py
9
main.py
|
@ -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]
|
||||||
await webhook_message.edit(content=edited_content)
|
|
||||||
|
try:
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in a new issue