mirror of
https://github.com/alterware/aw-bot.git
synced 2026-01-21 07:11:50 +00:00
fix: uncaught exception
This commit is contained in:
@@ -335,16 +335,23 @@ async def handle_message_delete(message, bot):
|
|||||||
inline=False,
|
inline=False,
|
||||||
) # noqa
|
) # noqa
|
||||||
|
|
||||||
if message.reference is not None:
|
try:
|
||||||
original_message = await message.channel.fetch_message(
|
if message.reference is not None:
|
||||||
message.reference.message_id
|
original_message = await message.channel.fetch_message(
|
||||||
)
|
message.reference.message_id
|
||||||
|
)
|
||||||
|
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Replied",
|
name="Replied",
|
||||||
value=original_message.author.mention,
|
value=original_message.author.mention,
|
||||||
inline=False, # noqa
|
inline=False, # noqa
|
||||||
) # noqa
|
) # noqa
|
||||||
|
except discord.NotFound:
|
||||||
|
logger.warning("Referenced message not found")
|
||||||
|
except discord.Forbidden:
|
||||||
|
logger.error("No permission to access the referenced message")
|
||||||
|
except discord.HTTPException as e:
|
||||||
|
logger.error(f"Error fetching message: {e}")
|
||||||
|
|
||||||
embed.set_footer(
|
embed.set_footer(
|
||||||
text=f"Message ID: {message.id} | Author ID: {message.author.id}" # noqa
|
text=f"Message ID: {message.id} | Author ID: {message.author.id}" # noqa
|
||||||
|
|||||||
Reference in New Issue
Block a user