random choice of image now
This commit is contained in:
parent
f7f9ddef68
commit
1996d4eeee
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ class Waifu(commands.Cog):
|
||||||
async with self.bot.http_session.get(self.url, params=params) as resp:
|
async with self.bot.http_session.get(self.url, params=params) as resp:
|
||||||
resp_data = await resp.json()
|
resp_data = await resp.json()
|
||||||
try:
|
try:
|
||||||
image = resp_data['images'][0]
|
image = random.choice(resp_data['images'])
|
||||||
return image['url']
|
return image['url']
|
||||||
except:
|
except:
|
||||||
if resp_data['detail'] == "No image found matching the criteria given.":
|
if resp_data['detail'] == "No image found matching the criteria given.":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue