From bf6a029c7e95d995b0056e44568534f8f9a78497 Mon Sep 17 00:00:00 2001 From: pocketjawa Date: Thu, 25 May 2017 00:55:33 -0400 Subject: [PATCH] Added command to post random mix --- helpcommand.txt | 1 + pocketbot.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/helpcommand.txt b/helpcommand.txt index c393d7e..767c4c5 100644 --- a/helpcommand.txt +++ b/helpcommand.txt @@ -2,6 +2,7 @@ **!help**: show this help blurb **!maki** or **!monday**: Posts a picture of Maki. Don't forget to praise on Monday! **!mixes**: post link to my fire mixtapes +**!rmix**: post link to a random mix of mine **!sleep**: sleep for like 5 seconds for some reason **!pokeme**: make the bot poke you gently **!switch**: display time until the switch comes out! diff --git a/pocketbot.py b/pocketbot.py index 10051b3..1526d71 100644 --- a/pocketbot.py +++ b/pocketbot.py @@ -246,6 +246,12 @@ def on_message(message): npem = discord.Embed(title="Now Playing on ToukuFM", description=output, url="https://toukufm.com/") yield from client.send_message(message.channel, embed=npem) + #Post a random mix + elif message.content.lower().startswith('!rmix'): + mixes = json.loads(requests.get("http://maki.pocketjawa.com/mixesjson/").text) + yield from client.send_message(message.channel, "http://maki.pocketjawa.com/mixes/" + random.choice(mixes)['name']) + + client.loop.create_task(ups_check()) client.run(token) \ No newline at end of file