1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-05-17 23:35:53 +02:00

fixed jensmeme

This commit is contained in:
Jonas Leder 2020-06-28 17:32:15 +02:00
parent 40d7a71352
commit cf785faf0a

8
bot.py
View file

@ -450,12 +450,8 @@ async def fail(ctx):
@bot.command(pass_context=True, brief="sends a random upload from jensmemes.tilera.xyz")
async def jensmeme(ctx):
await ctx.message.add_reaction("")
r = get("https://jensmemes.tilera.xyz/random.php") # get random upload
url = "https://jensmemes.tilera.xyz/" + r.text.split("href='")[1].split("'")[0]
r = get(url)#get the url to the fail
image_data = BytesIO(r.content)#download tthe image and load it into BytesIO
image_data.seek(0)
await ctx.send(file=discord.File(image_data, 'jensmeme.' + url.split(".")[-1]))#send the fail image
r = get("https://jensmemes.tilera.xyz/randomapi.php") # get random upload
await ctx.send(r.text)#send the fail image
# ___ ___ _ ______ _
# | \/ | (_) | ___ \ | |
# | . . | _ _ ___ _ ___ | |_/ / ___ | |_