Added command to post random /r/EarthPorn pic
parent
660c3106d5
commit
8be6b0a440
|
@ -11,4 +11,5 @@
|
|||
**!setplaying**: Sets the bot's Now Playing status to whatever you say (eg !setplaying with Tohru)
|
||||
**!xkcd**: Posts a random xkcd comic
|
||||
**!xkcd latest**: Posts the latest xkcd comic
|
||||
**!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
|
|
@ -123,6 +123,12 @@ def on_message(message):
|
|||
else:
|
||||
yield from client.send_message(message.channel, '`'+args+'`' + 'is not a valid option. Please leave blank for a random comic, say "latest" for the latest comic or put the number of the comic you want.' )
|
||||
|
||||
#Post random submisison from /r/EarthPorn's top this week
|
||||
elif (message.content.lower().startswith('!earth')) or (message.content.lower().startswith('!earthporn')):
|
||||
earthporn = reddit.subreddit('earthporn').top('week')
|
||||
earthpornr = list(earthporn)
|
||||
yield from client.send_message(message.channel, random.choice(earthpornr).url)
|
||||
|
||||
|
||||
client.loop.create_task(ups_check())
|
||||
client.run(token)
|
Loading…
Reference in New Issue