fix
This commit is contained in:
@@ -284,14 +284,17 @@ def command_choose(argv, **args):
|
|||||||
alternatives = argv
|
alternatives = argv
|
||||||
binary = ['Yes', 'No', 'Maybe']
|
binary = ['Yes', 'No', 'Maybe']
|
||||||
|
|
||||||
# single choose request
|
# single or no choice
|
||||||
if 'choose' not in alternatives:
|
if len(alternatives) < 2:
|
||||||
log.info('sent random choice')
|
|
||||||
return {
|
return {
|
||||||
'msg': '%s: I prefer %s!' % (args['reply_user'], random.choice(alternatives))
|
'msg': '{}: {}.'.format(args['reply_user'], random.choice(binary))
|
||||||
|
}
|
||||||
|
elif 'choose' not in alternatives:
|
||||||
|
choice = random.choice(alternatives)
|
||||||
|
return {
|
||||||
|
'msg': '%s: I prefer %s!' % (args['reply_user'], choice)
|
||||||
}
|
}
|
||||||
|
|
||||||
# multiple choices
|
|
||||||
def choose_between(options):
|
def choose_between(options):
|
||||||
responses = []
|
responses = []
|
||||||
current_choices = []
|
current_choices = []
|
||||||
|
|||||||
Reference in New Issue
Block a user