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

46 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",
2012-02-28 03:03:43 +01:00
g + "One would be wise to think so",
g + "Naturally",
2011-11-20 10:23:31 +01:00
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",
2012-02-28 03:03:43 +01:00
y + "You know the answer better than I",
y + "Maybe...",
r + "You're kidding, right?",
2011-11-20 10:23:31 +01:00
r + "Don't count on it",
2012-02-29 06:09:40 +01:00
r + "In your dreams",
2011-11-20 10:23:31 +01:00
r + "My reply is no",
r + "My sources say no",
r + "Outlook not so good",
r + "Very doubtful"]
2012-02-29 06:09:40 +01:00
2011-11-20 10:23:31 +01:00
@hook.command('8ball')
2012-02-16 11:30:06 +01:00
def eightball(inp, me=None):
2012-02-29 06:09:40 +01:00
".8ball <question> -- The all knowing magic eight ball, "\
"in electronic form. Ask and it shall be answered!"
2011-11-20 10:23:31 +01:00
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)))