Added Magic 8ball and Magic Conch Shell commands

dev
pocketjawa 2017-03-02 12:21:56 -05:00
parent bb35612ce2
commit 5b26e39cc7
3 changed files with 43 additions and 1 deletions

View File

@ -15,4 +15,6 @@
**!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)
**!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
**!joke**: Posts a random joke from /r/Jokes
**!8ball**: You ask a question, it answeres. Simple!
**!conch** or **!magicconch**: Same as the 8ball command but waaaaay cooler

20
lists/8ball_responses.txt Normal file
View File

@ -0,0 +1,20 @@
It is certain
It is decidedly so
Without a doubt
Yes definitely
You may rely on it
As I see it, yes
Most likely
Outlook good
Yes
Signs point to yes
Reply hazy try again
Ask again later
Better not tell you now
Cannot predict now
Concentrate and ask again
Don't count on it
My reply is no
My sources say no
Outlook not so good
Very doubtful

View File

@ -156,6 +156,26 @@ def on_message(message):
jokemsg = jokesr.title + '\n\n' + jokesr.selftext
yield from client.send_message(message.channel, jokemsg)
#Magic 8-ball simulator 2017
elif message.content.lower().startswith('!8ball'):
ball_response_file = open("/srv/discord-pocketbot/lists/8ball_responses.txt", "r")
ball_responses = ball_response_file.read().split('\n')
args = message.content.partition(' ')[2]
if (args is ''):
yield from client.send_message(message.channel, 'Please include a question for me to answer. I\'m not _that_ psychic...')
else:
yield from client.send_message(message.channel, 'The Magic 8-ball says... ' + random.choice(ball_responses))
#Magic Conch Shell simulator 2002 (way cooler than that lame "Magic" 8-ball)
elif message.content.lower().startswith('!conch') or message.content.lower().startswith('!magicconch'):
ball_response_file = open("/srv/discord-pocketbot/lists/8ball_responses.txt", "r")
ball_responses = ball_response_file.read().split('\n')
args = message.content.partition(' ')[2]
if (args is ''):
yield from client.send_message(message.channel, 'Please include a question for me to answer. I\'m not _that_ psychic...')
else:
yield from client.send_message(message.channel, 'The Magic Conch Shell says... ' + random.choice(ball_responses))
client.loop.create_task(ups_check())
client.run(token)