I'm sure there was a reason this was complicated.
This commit is contained in:
parent
8c60a923ba
commit
a211115b7e
|
@ -1,4 +1,3 @@
|
|||
import re
|
||||
import random
|
||||
|
||||
from util import hook
|
||||
|
@ -6,13 +5,10 @@ from util import hook
|
|||
|
||||
@hook.command
|
||||
def choose(inp):
|
||||
"""choose <choice1>, [choice2], [choice3] ... [choiceN]
|
||||
"""choose <choice1>, [choice2], [choice3]
|
||||
Randomly picks one of the given choices."""
|
||||
|
||||
c = re.findall(r'([^,]+)', inp)
|
||||
c = inp.split(" ")
|
||||
if len(c) == 1:
|
||||
c = re.findall(r'(\S+)', inp)
|
||||
if len(c) == 1:
|
||||
return 'The decision is up to you!'
|
||||
|
||||
return 'banana'
|
||||
return random.choice(c).strip()
|
||||
|
|
Reference in a new issue