Handle exception on editing messages, send attachment URL with embed aswell

This commit is contained in:
git-bruh 2021-01-04 12:27:01 +05:30
parent 1c1bb7de97
commit 90ba32a767
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -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