Correct how to get horse/snek
This commit is contained in:
parent
33842a145f
commit
a2cd241265
|
@ -72,13 +72,13 @@ class Images(commands.Cog):
|
||||||
await ctx.send("I couldn't connect! Sorry no snakes right now ;w;")
|
await ctx.send("I couldn't connect! Sorry no snakes right now ;w;")
|
||||||
return
|
return
|
||||||
result = data['data']
|
result = data['data']
|
||||||
filename = result.get('file_url_size_large', None)
|
filename = result.get('file_name')
|
||||||
if filename is None:
|
url = result.get('file_url_size_large')
|
||||||
|
if url is None:
|
||||||
await ctx.send("I couldn't connect! Sorry no snakes right now ;w;")
|
await ctx.send("I couldn't connect! Sorry no snakes right now ;w;")
|
||||||
return
|
return
|
||||||
|
|
||||||
image = await utils.download_image(filename)
|
image = await utils.download_image(url)
|
||||||
filename = re.search('.*/optimized/large/(.*)', filename).group(1)
|
|
||||||
f = discord.File(image, filename=filename)
|
f = discord.File(image, filename=filename)
|
||||||
try:
|
try:
|
||||||
await ctx.send(file=f)
|
await ctx.send(file=f)
|
||||||
|
@ -100,13 +100,13 @@ class Images(commands.Cog):
|
||||||
await ctx.send("I couldn't connect! Sorry no horses right now ;w;")
|
await ctx.send("I couldn't connect! Sorry no horses right now ;w;")
|
||||||
return
|
return
|
||||||
result = data['data']
|
result = data['data']
|
||||||
filename = result.get('file_url_size_large', None)
|
filename = result.get('file_name')
|
||||||
if filename is None:
|
url = result.get('file_url_size_large')
|
||||||
|
if url is None:
|
||||||
await ctx.send("I couldn't connect! Sorry no horses right now ;w;")
|
await ctx.send("I couldn't connect! Sorry no horses right now ;w;")
|
||||||
return
|
return
|
||||||
|
|
||||||
image = await utils.download_image(filename)
|
image = await utils.download_image(url)
|
||||||
filename = re.search('.*/optimized/large/(.*)', filename).group(1)
|
|
||||||
f = discord.File(image, filename=filename)
|
f = discord.File(image, filename=filename)
|
||||||
try:
|
try:
|
||||||
await ctx.send(file=f)
|
await ctx.send(file=f)
|
||||||
|
|
Loading…
Reference in a new issue