Added command to pull random joke from /r/Jokes
parent
efab1cd487
commit
bb35612ce2
|
@ -14,4 +14,5 @@
|
||||||
**!xkcd x**: Posts xkcd comic number x (if it exists)
|
**!xkcd x**: Posts xkcd comic number x (if it exists)
|
||||||
**!earth** or **!earthporn**: Posts a random submission from /r/EarthPorn's top this week
|
**!earth** or **!earthporn**: Posts a random submission from /r/EarthPorn's top this week
|
||||||
**!porn**: Posts a random link from one of the 'porn' subreddits (not actually NSFW)
|
**!porn**: Posts a random link from one of the 'porn' subreddits (not actually NSFW)
|
||||||
**!kill** or **!restart**: Kill the bot process so that it can automatically restart with the new version (only pocketjawa can use these)
|
**!kill** or **!restart**: Kill the bot process so that it can automatically restart with the new version (only pocketjawa can use these)
|
||||||
|
**!joke**: Posts a random joke from /r/Jokes
|
|
@ -149,6 +149,13 @@ def on_message(message):
|
||||||
else:
|
else:
|
||||||
yield from client.send_message(message.channel, 'Booooo you\'re not Onii-chan. You\'re not allowed to use this command!')
|
yield from client.send_message(message.channel, 'Booooo you\'re not Onii-chan. You\'re not allowed to use this command!')
|
||||||
|
|
||||||
|
#Random jokes from /r/jokes
|
||||||
|
elif message.content.lower().startswith('!joke'):
|
||||||
|
jokes = reddit.subreddit('jokes').top('week')
|
||||||
|
jokesr = random.choice(list(jokes))
|
||||||
|
jokemsg = jokesr.title + '\n\n' + jokesr.selftext
|
||||||
|
yield from client.send_message(message.channel, jokemsg)
|
||||||
|
|
||||||
|
|
||||||
client.loop.create_task(ups_check())
|
client.loop.create_task(ups_check())
|
||||||
client.run(token)
|
client.run(token)
|
Loading…
Reference in New Issue