From 63972faa63b3d7a7f0804656c73f679b03d22c0f Mon Sep 17 00:00:00 2001 From: Michelle Date: Sat, 25 Apr 2026 17:14:25 +0200 Subject: [PATCH] fix: racoon command should work now --- main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 0861170..946a190 100644 --- a/main.py +++ b/main.py @@ -170,17 +170,13 @@ async def racoon(message): if response.status_code != 200: await message.channel.send("Failed to fetch racoon image") return - match = re.match(r"data:image/(\w+);base64,(.+)", response.text.strip()) - if not match: - await message.channel.send("Could not fetch racoon image") - return - ext, payload = match.group(1), match.group(2) + _, _, payload = response.text.strip().partition(",") try: image_bytes = base64.b64decode(payload) except (ValueError, base64.binascii.Error): await message.channel.send("Could not decode racoon image") return - await message.channel.send(file=fluxer.File(image_bytes, filename=f"racoon.{ext}")) + await message.channel.send(file=fluxer.File(image_bytes, filename="racoon.jpg")) async def post_reddit(): subreddit = os.getenv("SUBREDDIT", "ich_iel")