From 0c038a550d3af5b78530e829a4f62245ecf8f4fb Mon Sep 17 00:00:00 2001 From: Aaron Crate Date: Fri, 17 Nov 2023 20:52:59 +0000 Subject: [PATCH] rename image before send to discord --- garfbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/garfbot.py b/garfbot.py index d19c318..ab34370 100644 --- a/garfbot.py +++ b/garfbot.py @@ -112,10 +112,11 @@ async def process_image_requests(): image_data = await resp.read() timestamp = message.created_at.strftime('%Y%m%d%H%M%S') filename = f"images/{timestamp}_generated_image.png" + new_filename = f"{timestamp}_generated_image.png" # There is probably a better way to do this. with open(filename, "wb") as f: f.write(image_data) with open(filename, "rb") as f: - await message.channel.send(file=discord.File(f)) + await message.channel.send(file=discord.File(f, new_filename)) else: await message.channel.send("`GarfBot Error: Odie`") else: