25 lines
612 B
Python
25 lines
612 B
Python
|
import plugin, random
|
||
|
|
||
|
RNG = random.SystemRandom()
|
||
|
|
||
|
RESPONSES = ["I dunno, I think I'll go with \"{}\".","Hmm, it's a hard choice, but \"{}\".","Hmm... \"{}\". Hands down."]
|
||
|
|
||
|
@plugin.command("choose")
|
||
|
def choose(bot,channel,nick,*choices_raw):
|
||
|
choices = []
|
||
|
s = ""
|
||
|
quote = False
|
||
|
for choice in choices_raw:
|
||
|
if quote:
|
||
|
s+=" "+choice
|
||
|
if choice.endswith('"'):
|
||
|
quote = False
|
||
|
choices.append(s.strip('"'))
|
||
|
s = ""
|
||
|
elif choice.startswith('"'):
|
||
|
quote = True
|
||
|
s+=choice
|
||
|
else:
|
||
|
choices.append(choice)
|
||
|
bot.say(channel,"{}: {}".format(nick,RNG.choice(RESPONSES).format(RNG.choice(choices))))
|