From 5268fba2da30b04f7f574448b448a423412624e7 Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Wed, 6 Nov 2019 12:30:34 -0500 Subject: [PATCH] Add ability to generate more than 1 at a time --- commands/generate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/generate.py b/commands/generate.py index 1c44800..d123292 100644 --- a/commands/generate.py +++ b/commands/generate.py @@ -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)))