diff --git a/bot.py b/bot.py index b4fe1cd..a9804d2 100644 --- a/bot.py +++ b/bot.py @@ -393,14 +393,14 @@ async def result(ctx, id):#this function prints the result of a poll dbcursor.execute("DELETE FROM poll where pollID = ?", [id])#delete the entries from the poll in the database dbconnection.commit()#write the database to disk -# _____ _ -# / ____| | | -# | | __ _ | |_ -# | | / _` || __| -# | |____| (_| || |_ -# \_____|\__,_| \__| -# -# +# _ _ +# /\ (_) | | +# / \ _ __ _ _ __ ___ __ _ | | ___ +# / /\ \ | '_ \ | || '_ ` _ \ / _` || |/ __| +# / ____ \ | | | || || | | | | || (_| || |\__ \ +# /_/ \_\|_| |_||_||_| |_| |_| \__,_||_||___/ +# +# @bot.command(pass_context=True, brief="sends a random cat image") async def cat(ctx): @@ -410,6 +410,15 @@ async def cat(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, 'cat.jpg'))#send the cat image + +@bot.command(pass_context=True, brief="sends a random dog image") +async def dog(ctx): + r = get("https://random.dog/woof.json") # get random dog image + answer = loads(r.text) + r = get(answer["url"])#get the url to the cat + 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, 'dog.jpg'))#send the cat image # ___ ___ _ ______ _ # | \/ | (_) | ___ \ | | # | . . | _ _ ___ _ ___ | |_/ / ___ | |_