From 039e84a5540b725e08f13cabe285d143c4c6cbd9 Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Fri, 10 Jan 2020 12:39:28 -0500 Subject: [PATCH] Add prompt selection --- commands/prompt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/prompt.py b/commands/prompt.py index 784083b..4b09b66 100644 --- a/commands/prompt.py +++ b/commands/prompt.py @@ -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_))