1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00
This commit is contained in:
Thorsten
2016-05-27 21:48:33 +02:00
parent f7ab2cfbdd
commit d5886fbd94

View File

@@ -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 = []