Add prompt selection

This commit is contained in:
Robert Miles 2020-01-10 12:39:28 -05:00
parent 5afeb2f3f6
commit 039e84a554
1 changed files with 4 additions and 1 deletions

View File

@ -9,5 +9,8 @@ prompts = get("https://khuxkm.tilde.team/prompts.json")["prompts"]
@plugin.command("prompt","")
def prompt(bot,channel,nick,*args):
prompt_ = random.choice(prompts)
if len(args)==1:
prompt_ = prompts[int(args[0])-1]
else:
prompt_ = random.choice(prompts)
bot.say(channel,"{}: {!s}. {}".format(nick,prompts.index(prompt_)+1,prompt_))