fix choice command
This commit is contained in:
parent
54011632fc
commit
dc797fdaab
|
@ -40,7 +40,7 @@ def choose(bot, trigger):
|
|||
"""
|
||||
if len(trigger.args) < 2:
|
||||
return bot.reply("Choose what?")
|
||||
choices = trigger.args[1].split('|')
|
||||
choices = trigger.msg.partition(' ')[2].split('|')
|
||||
pick = random.choice(choices)
|
||||
msg = f"Your options: {'|'.join(choices)}. My choice: {pick}"
|
||||
bot.reply(msg)
|
||||
|
|
|
@ -47,6 +47,9 @@ class Trigger():
|
|||
self.args = message.strip().split(' ')
|
||||
"""Pseudo-ARGV for a bot command."""
|
||||
|
||||
self.msg = message
|
||||
"""Retain the original message."""
|
||||
|
||||
admins = config.admins + [config.owner]
|
||||
self.admin = any([user == admin for admin in admins])
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user