Handle exception on editing messages, send attachment URL with embed aswell
This commit is contained in:
parent
1c1bb7de97
commit
90ba32a767
1 changed files with 4 additions and 2 deletions
6
main.py
6
main.py
|
@ -282,7 +282,9 @@ class Callbacks(object):
|
|||
|
||||
try:
|
||||
await webhook_message.edit(content=edited_content)
|
||||
except discord.errors.NotFound as e:
|
||||
except (
|
||||
discord.errors.NotFound, discord.errors.HTTPException
|
||||
) as e:
|
||||
self.matrix_client.logger.warning(
|
||||
f"Failed to edit message {edited_event}: {e}"
|
||||
)
|
||||
|
@ -312,7 +314,7 @@ class Callbacks(object):
|
|||
embed = discord.Embed(colour=discord.Colour.blue(), title=message)
|
||||
embed.set_image(url=attachment)
|
||||
|
||||
message = None
|
||||
message = attachment
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue