diff --git a/modules/rand.py b/modules/rand.py index c8e3dce..32acb62 100755 --- a/modules/rand.py +++ b/modules/rand.py @@ -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) diff --git a/trigger.py b/trigger.py index 0b6d6de..dde9d09 100755 --- a/trigger.py +++ b/trigger.py @@ -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]) """