1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-11-20 10:13:03 +01:00

added jensmeme command

This commit is contained in:
Jonas Leder 2020-06-28 16:47:57 +02:00
parent 6011802d12
commit 1849e47a17

9
bot.py
View file

@ -438,6 +438,15 @@ async def fail(ctx):
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, 'fail.gif'))#send the fail image
@bot.command(pass_context=True, brief="sends a random upload from jensmemes.tilera.xyz")
async def jensmeme(ctx):
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
# ___ ___ _ ______ _
# | \/ | (_) | ___ \ | |
# | . . | _ _ ___ _ ___ | |_/ / ___ | |_