fix: update dog and fox commands, they should actually work now
Build and publish ich_iel bot / build (push) Successful in 1m31s

This commit is contained in:
2026-04-25 16:47:08 +02:00
parent 8615cc4d0d
commit 6df7d68f5a
+4 -4
View File
@@ -139,8 +139,8 @@ async def dog(message):
response = requests.get("https://dog.ceo/api/breeds/image/random") response = requests.get("https://dog.ceo/api/breeds/image/random")
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
if data and isinstance(data, list) and "message" in data[0]: if data and isinstance(data, dict) and "message" in data:
await message.channel.send(data[0]["message"]) await message.channel.send(data["message"])
else: else:
await message.channel.send("Could not fetch dog image") await message.channel.send("Could not fetch dog image")
else: else:
@@ -151,8 +151,8 @@ async def fox(message):
response = requests.get("https://randomfox.ca/floof/") response = requests.get("https://randomfox.ca/floof/")
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
if data and isinstance(data, list) and "image" in data[0]: if data and isinstance(data, dict) and "image" in data:
await message.channel.send(data[0]["image"]) await message.channel.send(data["image"])
else: else:
await message.channel.send("Could not fetch fox image") await message.channel.send("Could not fetch fox image")
else: else: