Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
[8Ball] Feed single-item 'Should I' options to the oracle. Blame @sienf
Browse files Browse the repository at this point in the history
  • Loading branch information
aquarion committed Jan 31, 2012
1 parent b86e455 commit c79e795
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lampstand/reactions/eightball.py
Expand Up @@ -18,12 +18,17 @@ class Reaction(lampstand.reactions.base.Reaction):
uses = []

def __init__(self, connection):
self.channelMatch = re.compile('^%s. ?ask the [oracle|8.ball]' % connection.nickname, re.IGNORECASE)
self.channelMatch = (re.compile('^%s. ?ask the [oracle|8.ball]' % connection.nickname, re.IGNORECASE),
re.compile('^%s. should I .*' % connection.nickname, re.IGNORECASE))


def channelAction(self, connection, user, channel, message):
def channelAction(self, connection, user, channel, message, matchIndex):
print "[8Ball] called"

if not message.lower().find(" or ") == -1:
print "[8Ball] ... That looks like a choice to me"
return False


if self.overUsed(self.uses, self.cooldown_number, self.cooldown_time):
connection.msg(user, "The 8-ball says: 'Find a new prophet, I quit.', I'd give it a while to cool down." )
Expand Down

0 comments on commit c79e795

Please sign in to comment.