From 231e74c34ebdd03849785cd863f133801e9433e2 Mon Sep 17 00:00:00 2001 From: Alexander Terry Date: Fri, 20 Sep 2024 07:15:39 -0800 Subject: [PATCH] add error logging on fail to upload images --- alexBot/cogs/video_dl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/alexBot/cogs/video_dl.py b/alexBot/cogs/video_dl.py index 70efb77..f01906b 100644 --- a/alexBot/cogs/video_dl.py +++ b/alexBot/cogs/video_dl.py @@ -134,7 +134,11 @@ async def on_message(self, message: discord.Message, override=False, new_deleter else: filename = image.content_disposition.filename attachments.append(discord.File(io.BytesIO(stuff), filename=filename)) - uploaded = await message.reply(mention_author=False, files=attachments) + try: + + uploaded = await message.reply(mention_author=False, files=attachments) + except DiscordException as e: + log.error("Error uploading images", e) case "error": log.error(f"Error in cobalt with url {rq.url}: {res.text}") log.debug("on_message function ended")