let someone know if they need to provide a link to an image

This commit is contained in:
Luke Robles 2021-07-11 11:53:19 -07:00
parent 4040022569
commit c1775f767d

View File

@ -298,6 +298,8 @@ async def roles(ctx):
@bot.command(name='simp') @bot.command(name='simp')
async def simp(ctx): async def simp(ctx):
if len(ctx.message.content.split()) == 1:
return await ctx.send('You must provide a link to an image')
response = requests.get("https://some-random-api.ml/canvas/simpcard/?avatar=%s" % ctx.message.content.split()[-1]) response = requests.get("https://some-random-api.ml/canvas/simpcard/?avatar=%s" % ctx.message.content.split()[-1])
with open('/app/simp.jpg', 'wb') as f: with open('/app/simp.jpg', 'wb') as f:
f.write(response.content) f.write(response.content)
@ -306,6 +308,8 @@ async def simp(ctx):
@bot.command(name='horny') @bot.command(name='horny')
async def horny(ctx): async def horny(ctx):
if len(ctx.message.content.split()) == 1:
return await ctx.send('You must provide a link to an image')
response = requests.get("https://some-random-api.ml/canvas/horny/?avatar=%s" % ctx.message.content.split()[-1]) response = requests.get("https://some-random-api.ml/canvas/horny/?avatar=%s" % ctx.message.content.split()[-1])
with open('/app/horny.jpg', 'wb') as f: with open('/app/horny.jpg', 'wb') as f:
f.write(response.content) f.write(response.content)
@ -314,6 +318,8 @@ async def horny(ctx):
@bot.command(name='wasted') @bot.command(name='wasted')
async def wasted(ctx): async def wasted(ctx):
if len(ctx.message.content.split()) == 1:
return await ctx.send('You must provide a link to an image')
response = requests.get("https://some-random-api.ml/canvas/wasted/?avatar=%s" % ctx.message.content.split()[-1]) response = requests.get("https://some-random-api.ml/canvas/wasted/?avatar=%s" % ctx.message.content.split()[-1])
with open('/app/wasted.jpg', 'wb') as f: with open('/app/wasted.jpg', 'wb') as f:
f.write(response.content) f.write(response.content)