First draft of prompt function
This commit is contained in:
parent
031060a80e
commit
d6a7a7b40a
|
@ -0,0 +1,13 @@
|
|||
import plugin,requests,random
|
||||
|
||||
def get(*args,**kwargs):
|
||||
r = requests.get(*args,**kwargs)
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
prompts = get("https://khuxkm.tilde.team/prompts.json")["prompts"]
|
||||
|
||||
@plugin.command("prompt","")
|
||||
def prompt(bot,channel,nick,*args):
|
||||
prompt_ = random.choice(prompts)
|
||||
bot.say(channel,"{}: {!s}. {}".format(nick,prompts.index(prompt_)+1,prompt_))
|
Loading…
Reference in New Issue