fix .choose bugs
This commit is contained in:
committed by
mutantmonkey
parent
72135ea0ed
commit
9ffdc28102
@@ -11,12 +11,11 @@ def choose(phenny, input):
|
|||||||
origterm = input.groups()[1]
|
origterm = input.groups()[1]
|
||||||
if not origterm:
|
if not origterm:
|
||||||
return phenny.say(".choose <red> <blue> - for when you just can't decide")
|
return phenny.say(".choose <red> <blue> - for when you just can't decide")
|
||||||
origterm = origterm
|
c = re.findall(r'([^,]+)', origterm)
|
||||||
c = re.findall(r'([^,]+)', input)
|
|
||||||
if len(c) == 1:
|
if len(c) == 1:
|
||||||
c = re.findall(r'(\S+)', input)
|
c = re.findall(r'(\S+)', origterm)
|
||||||
if len(c) == 1:
|
if len(c) == 1:
|
||||||
return phenny.reply("%s" % (c))
|
return phenny.reply("%s" % (c.strip()))
|
||||||
fate = random.choice(c).strip()
|
fate = random.choice(c).strip()
|
||||||
return phenny.reply("%s" % (fate))
|
return phenny.reply("%s" % (fate))
|
||||||
choose.rule = (['choose'], r'(.*)')
|
choose.rule = (['choose'], r'(.*)')
|
||||||
|
|||||||
Reference in New Issue
Block a user