mirror of
https://gitlab.jonasled.de/jonasled/discordbot
synced 2024-06-01 18:03:12 +02:00
fixed jensmeme
This commit is contained in:
parent
40d7a71352
commit
cf785faf0a
8
bot.py
8
bot.py
|
@ -450,12 +450,8 @@ async def fail(ctx):
|
||||||
@bot.command(pass_context=True, brief="sends a random upload from jensmemes.tilera.xyz")
|
@bot.command(pass_context=True, brief="sends a random upload from jensmemes.tilera.xyz")
|
||||||
async def jensmeme(ctx):
|
async def jensmeme(ctx):
|
||||||
await ctx.message.add_reaction("✅")
|
await ctx.message.add_reaction("✅")
|
||||||
r = get("https://jensmemes.tilera.xyz/random.php") # get random upload
|
r = get("https://jensmemes.tilera.xyz/randomapi.php") # get random upload
|
||||||
url = "https://jensmemes.tilera.xyz/" + r.text.split("href='")[1].split("'")[0]
|
await ctx.send(r.text)#send the fail image
|
||||||
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
|
|
||||||
# ___ ___ _ ______ _
|
# ___ ___ _ ______ _
|
||||||
# | \/ | (_) | ___ \ | |
|
# | \/ | (_) | ___ \ | |
|
||||||
# | . . | _ _ ___ _ ___ | |_/ / ___ | |_
|
# | . . | _ _ ___ _ ___ | |_/ / ___ | |_
|
||||||
|
|
Loading…
Reference in a new issue