Add ask command
I'm piggybacking off of WriterBot for the question lists, mainly to save space on cosmic.
This commit is contained in:
parent
d6a7a7b40a
commit
856a382907
|
@ -0,0 +1,21 @@
|
|||
import plugin,utils,random
|
||||
|
||||
chars = utils.get("https://raw.githack.com/cwarwicker/discord-WriterBot/master/assets/json/en/q_char.json")
|
||||
world = utils.get("https://raw.githack.com/cwarwicker/discord-WriterBot/master/assets/json/en/q_world.json")
|
||||
|
||||
@plugin.group("ask","<c/w>")
|
||||
def ask(bot,channel,nick,subcmd,*args):
|
||||
if subcmd not in "cw":
|
||||
bot.say(channel,"{}: Usage: !ask <c/w>".format(nick))
|
||||
return True
|
||||
return False
|
||||
|
||||
@ask.command("c")
|
||||
def ask_char(bot,channel,nick,*args):
|
||||
question = random.choice(chars)
|
||||
bot.say(channel,nick,"{}: {!s}. {}".format(nick,chars.index(question),question))
|
||||
|
||||
@ask.command("w")
|
||||
def ask_world(bot,channel,nick,*args):
|
||||
question = random.choice(world)
|
||||
bot.say(channel,nick,"{}: {!s}. {}".format(nick,world.index(question),question))
|
Loading…
Reference in New Issue