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,6 +335,7 @@ async def handle_message_delete(message, bot):
|
||||
inline=False,
|
||||
) # noqa
|
||||
|
||||
try:
|
||||
if message.reference is not None:
|
||||
original_message = await message.channel.fetch_message(
|
||||
message.reference.message_id
|
||||
@@ -345,6 +346,12 @@ async def handle_message_delete(message, bot):
|
||||
value=original_message.author.mention,
|
||||
inline=False, # 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(
|
||||
text=f"Message ID: {message.id} | Author ID: {message.author.id}" # noqa
|
||||
|
||||
Reference in New Issue
Block a user