From 36b5de41f1e769e3a87805810a4f256a512836cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xeva=E1=B5=88=E1=B5=89=E1=B5=9B=20=5BCrystal=5D?= Date: Sun, 13 Sep 2026 16:38:53 +0000 Subject: [PATCH] Raccoon image command added using the racc.lol api --- bot/commands/img.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bot/commands/img.py b/bot/commands/img.py index 419a656..427c45e 100644 --- a/bot/commands/img.py +++ b/bot/commands/img.py @@ -4,6 +4,7 @@ import random import mimetypes import shutil +from io import BytesIO from discord.ext import commands from utils import config, files @@ -59,6 +60,15 @@ async def fox(self, ctx): await ctx.send(image) + @commands.command(name="raccoon", description="Get a random raccoon picture.", aliases=["rac","racc","racpic","raccpic"], usage="") + async def raccoon(self, ctx): + cfg = self.cfg + resp = requests.get("https://api.racc.lol/raccoon", timeout=15) + resp.raise_for_status() + extension = mimetypes.guess_extension(resp.headers.get("content-type", "image/jpeg").split(";")[0]) or ".jpg" + + await ctx.send(file=discord.File(BytesIO(resp.content), filename=f"raccoon{extension}")) + @commands.command(name="minion", description="Get a random minion meme.", aliases=["minionmeme"], usage="") async def minion(self, ctx): cfg = self.cfg