This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/8ball.py

44 lines
1.3 KiB
Python
Raw Normal View History

2011-11-20 10:23:31 +01:00
from util import hook
import random
import re
r = "\x02\x0305" # red
g = "\x02\x0303" # green
y = "\x02\x0308" # yellow
answers = [g + "As I see it, yes",
g + "It is certain",
g + "It is decidedly so",
g + "Most likely",
g + "Outlook good",
g + "Signs point to yes",
g + "One would be wise to think so",#
g + "Naturally",#
g + "Without a doubt",
g + "Yes",
g + "Yes, definitely",
g + "You may rely on it",
y + "Reply hazy, try again",
y + "Ask again later",
y + "Better not tell you now",
y + "Cannot predict now",
y + "Concentrate and ask again",
y + "You know the answer better than I",#
y + "Maybe...",#
r + "You're kidding, right?",#
r + "Don't count on it",
r + "In your dreams", #
r + "My reply is no",
r + "My sources say no",
r + "Outlook not so good",
r + "Very doubtful"]
@hook.command('8ball')
2012-02-16 11:30:06 +01:00
def eightball(inp, me=None):
2011-11-20 10:23:31 +01:00
".8ball <question> - The all knowing magic eight ball, in electronic form. Ask a question and the answer shall be provided."
global nextresponsenumber
inp = inp.strip()
if re.match("[a-zA-Z0-9]", inp[-1]):
inp += "?"
me("shakes the magic 8 ball... %s" % (random.choice(answers)))