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

Commit

Permalink
Browse files Browse the repository at this point in the history
Apply promised changes to Choose
Choose now requires "choose" or "should I" prefixes, will not warn if you miss them.
  • Loading branch information
aquarion committed Oct 22, 2011
1 parent 147bd52 commit 65c2c2a
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions lampstand/reactions/choose.py
Expand Up @@ -16,7 +16,7 @@ class Reaction(lampstand.reactions.base.Reaction):
uses = []

def __init__(self, connection):
self.channelMatch = re.compile('^%s. (.* or .*)' % connection.nickname, re.IGNORECASE)
self.channelMatch = re.compile('^%s. (choose|should I) (.* or .*)' % connection.nickname, re.IGNORECASE)
self.privateMatch = re.compile('(.* or .*)\??$', re.IGNORECASE)

def channelAction(self, connection, user, channel, message):
Expand All @@ -31,9 +31,6 @@ def channelAction(self, connection, user, channel, message):

match = self.channelMatch.findall(message)

if match[0][0:7].lower() == "define ":
return False


if random.randint(0,100) == 69:
print "Yes";
Expand All @@ -45,7 +42,8 @@ def channelAction(self, connection, user, channel, message):
connection.msg(channel, "%s: edge" % user)
return True

reaction = self.choose(match[0])
print match
reaction = self.choose(match[0][1])
if reaction.lower() == "death" and user.lower() != "aquarion":
connection.kick(channel,user, "Death.")
elif reaction.lower() == "boom" and user.lower():
Expand Down Expand Up @@ -76,13 +74,6 @@ def choose(self, message):
if message[-1:] == "?":
message = message[:-1]

if message[0:7].lower() == "choose ":
message = message[7:]
else:
return "Sorry, You need to prefix that with \"choose\" now."
pass

print message[0:7]
print message

#new regex by ccooke - 2010-05-28
Expand Down

0 comments on commit 65c2c2a

Please sign in to comment.