Conditions | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | from event import Event |
||
23 | def handle(self, event): |
||
24 | try: |
||
25 | flavortext = ["Always go with ", |
||
26 | "I don't always choose, but when I do, I choose ", |
||
27 | "Wisdom says you should pick ", |
||
28 | "The wise one selects ", |
||
29 | "The spinner selects ", |
||
30 | "My gut says to go with ", |
||
31 | "Easy. I choose ", |
||
32 | "I choose "] |
||
33 | choices = event.msg.split(None, 1)[1].split("|") |
||
34 | if len(choices) == 1: |
||
35 | self.say(event.channel, "If you only have one option, the choice is easy. Go with " + choices[0].strip()) |
||
36 | return |
||
37 | self.say(event.channel, random.choice(flavortext) + random.choice(choices).strip()) |
||
38 | except Exception as e: |
||
39 | self.say(event.channel, "I couldn't decide") |
||
40 | self.bot.debug_print("Error making decision in choice module") |
||
41 | self.bot.debug_print(str(e)) |
||
42 |