From b9e1740e10e5e6fd70c815b0cbc8611c8094e1d0 Mon Sep 17 00:00:00 2001 From: Michelle Date: Sat, 25 Apr 2026 16:39:23 +0200 Subject: [PATCH] feat: add dog and fox commands --- main.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/main.py b/main.py index 8edd7d0..24e1c79 100644 --- a/main.py +++ b/main.py @@ -133,6 +133,31 @@ async def cat(message): else: await message.channel.send("Failed to fetch cat image") +# i thought dogs and foxes would be nice to have too +@bot.command() +async def dog(message): + response = requests.get("https://dog.ceo/api/breeds/image/random") + if response.status_code == 200: + data = response.json() + if data and isinstance(data, list) and "url" in data[0]: + await message.channel.send(data[0]["url"]) + else: + await message.channel.send("Could not fetch dog image") + else: + await message.channel.send("Failed to fetch dog image") + +@bot.command() +async def fox(message): + response = requests.get("https://randomfox.ca/floof/") + if response.status_code == 200: + data = response.json() + if data and isinstance(data, list) and "url" in data[0]: + await message.channel.send(data[0]["url"]) + else: + await message.channel.send("Could not fetch fox image") + else: + await message.channel.send("Failed to fetch fox image") + async def post_reddit(): subreddit = os.getenv("SUBREDDIT", "ich_iel") posts = await get_latest_post(subreddit)