fix .choose bugs

master
Rebecca Stewart 2012-02-22 15:46:45 -05:00 committed by mutantmonkey
parent 72135ea0ed
commit 9ffdc28102
1 changed files with 3 additions and 4 deletions

View File

@ -11,12 +11,11 @@ def choose(phenny, input):
origterm = input.groups()[1]
if not origterm:
return phenny.say(".choose <red> <blue> - for when you just can't decide")
origterm = origterm
c = re.findall(r'([^,]+)', input)
c = re.findall(r'([^,]+)', origterm)
if len(c) == 1:
c = re.findall(r'(\S+)', input)
c = re.findall(r'(\S+)', origterm)
if len(c) == 1:
return phenny.reply("%s" % (c))
return phenny.reply("%s" % (c.strip()))
fate = random.choice(c).strip()
return phenny.reply("%s" % (fate))
choose.rule = (['choose'], r'(.*)')