Add ability to generate more than 1 at a time
This commit is contained in:
parent
6e2fb19e37
commit
5268fba2da
|
@ -30,10 +30,11 @@ def get_generator(name):
|
|||
GENERATORS = utils.LazyLoadedDict(get_generator)
|
||||
|
||||
@plugin.command("generate","<{}>".format("|".join(GENERATORS_LIST)))
|
||||
def generate(bot,channel,nick,generator):
|
||||
def generate(bot,channel,nick,generator,count="1"):
|
||||
if generator not in GENERATORS_LIST:
|
||||
bot.say(channel,"{}: Invalid generator!".format(nick))
|
||||
res = GENERATORS[generator]()
|
||||
count = int(count)
|
||||
res = [GENERATOR[generator]() for x in range(count)]
|
||||
if generator!="idea":
|
||||
res = titlecase.titlecase(res)
|
||||
bot.say(channel,"{}: {}".format(nick,res))
|
||||
res = [titlecase.titlecase(x) for x in res]
|
||||
bot.say(channel,"{}: {}".format(nick,",".join(res)))
|
||||
|
|
Loading…
Reference in New Issue