return Action(msg='%s: My choices are: %s!' % (sender, ', '.join(choose_between(alternatives))))
+class Magic8Ball(Worker):
+ binding_keys = ["nick.8ball.#"]
+ description = "answering all your questions"
+ usage = "bot: 8ball <your question>"
+
+ answers = [
+ "A Definite Yes",
+ "I Have My Doubts",
+ "You Will Have To Wait",
+ "Looking Good",
+ "Probably",
+ "Outlook So So",
+ "Don't Bet On It",
+ "Too Early To Predict",
+ "Who Knows",
+ "Absolutely",
+ "Absolutely Not",
+ "Go For It",
+ "You Can Count On It",
+ "Not Now",
+ "Forget About It",
+ "Looks Good To Me",
+ "Have My Doubts",
+ "Are You Kidding",
+ "Yes In Due Time",
+ "My Sources Say No",
+ "Yes",
+ ]
+
+ def parse_body(self, msg):
+ sender = get_nick_from_message(msg)
+
+ choice = random.choice(self.answers)
+ return Action(msg='%s: %s!' % (sender, choice))
+
+
class TeaTimer(Worker):
binding_keys = ["nick.teatimer.*", "nick.teatimer"]
description = 'sets a tea timer to $1 or currently %d seconds' % conf_get('plugins.teatimer.steep_time')
)
-ALL = [Dice, Dice20, Ping, XChoose, Coin, Choose, TeaTimer]
+ALL = [Dice, Dice20, Ping, XChoose, Coin, Choose, Magic8Ball, TeaTimer]
except UnicodeError as e:
message = 'Bug triggered (%s), invalid URL/domain part: %s' % (str(e), url)
logger.warning(message)
- return {'msg': message}
+ return Action(msg=message)
if title:
title = title.strip()