1
0
Fork 0
mirror of synced 2024-05-20 04:22:29 +12:00

Requested changes for Animal Image Fetch 3/4

This commit is contained in:
MahxieNoodle 2019-10-31 10:41:05 -06:00
parent f39e7d7efb
commit 8739ee30bc

View file

@ -55,10 +55,11 @@ class Images(commands.Cog):
EXAMPLE: !snek
RESULT: A beautiful picture of a snek o3o"""
data = await utils.request("http://hrsendl.com/api/snake")
result = data['data']
if result is None:
if data is None:
await ctx.send("I couldn't connect! Sorry no snakes right now ;w;")
return
result = data['data']
filename = result.get('file_url_size_large', None)
if filename is None:
await ctx.send("I couldn't connect! Sorry no snakes right now ;w;")
@ -77,10 +78,11 @@ class Images(commands.Cog):
EXAMPLE: !horse
RESULT: A beautiful picture of a horse o3o"""
data = await utils.request("http://hrsendl.com/api/horse")
result = data['data']
if result is None:
if data is None:
await ctx.send("I couldn't connect! Sorry no horses right now ;w;")
return
result = data['data']
filename = result.get('file_url_size_large', None)
if filename is None:
await ctx.send("I couldn't connect! Sorry no horses right now ;w;")