Add parameter checking so bitbot doesn't add a None webhook and break webhooks until restart

This commit is contained in:
Alyx Wolcott 2020-09-23 09:25:43 -05:00
parent b3c47fab82
commit 027b9d75f8

View file

@ -228,6 +228,9 @@ class Module(ModuleManager.BaseModule):
if existing_hook:
raise utils.EventError("There's already a hook for %s" %
hook_name)
if hook_name == None:
command = "%s%s" % (event["command_prefix"], event["command"])
raise utils.EventError("Not enough arguments (Usage: %s add <hook>)" % command)
all_hooks[hook_name] = {
"events": DEFAULT_EVENT_CATEGORIES.copy(),