Don't request a generator if you know it won't exist

This commit is contained in:
Robert Miles 2019-11-18 19:09:18 -05:00
parent b9a82f5956
commit 5afeb2f3f6
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@ GENERATORS = utils.LazyLoadedDict(get_generator)
def generate(bot,channel,nick,generator,count="1"):
if generator not in GENERATORS_LIST:
bot.say(channel,"{}: Invalid generator!".format(nick))
return
count = int(count)
res = [GENERATORS[generator]() for x in range(count)]
if generator!="idea":