Reshuffle key section

pull/1/head
Mark Veidemanis 7 years ago
parent 63396d54e3
commit e2682615ae

@ -633,7 +633,17 @@ class Helper(object):
helper.saveKeywordConfig()
success("Successfully added exception %s for keyword %s" % (spl[3], spl[2]))
return
elif spl[1] == "master":
if not spl[2] in pool.keys():
failure("Name does not exist: %s" % spl[2])
return
if spl[2] in IRCPool.keys():
if not spl[3] in IRCPool[spl[2]].channels:
info("Bot not on channel: %s" % spl[3])
config["Master"] = [spl[2], spl[3]]
helper.saveConfig()
success("Master set to %s on %s" % (spl[3], spl[2]))
return
elif spl[1] == "unexcept":
if not spl[2] in keyconf["KeywordsExcept"].keys():
failure("No such exception: %s" % spl[2])
@ -650,7 +660,7 @@ class Helper(object):
else:
incUsage("key")
return
if length == 3:
elif length == 3:
if spl[1] == "unexcept":
if not spl[2] in keyconf["KeywordsExcept"].keys():
failure("No such exception: %s" % spl[2])
@ -659,7 +669,9 @@ class Helper(object):
helper.saveKeywordConfig()
success("Successfully removed exception list of %s" % spl[2])
return
if length == 2:
else:
incUsage("key")
elif length == 2:
if spl[1] == "show":
info(",".join(keyconf["Keywords"]))
return
@ -672,31 +684,13 @@ class Helper(object):
exceptMap.append("\n")
info("\n".join(exceptMap))
return
if length == 4:
if spl[1] == "master":
if not spl[2] in pool.keys():
failure("Name does not exist: %s" % spl[2])
return
if spl[2] in IRCPool.keys():
if not spl[3] in IRCPool[spl[2]].channels:
info("Bot not on channel: %s" % spl[3])
config["Master"] = [spl[2], spl[3]]
helper.saveConfig()
success("Master set to %s on %s" % (spl[3], spl[2]))
return
elif length == 2:
if spl[1] == "master":
elif spl[1] == "master":
info(" - ".join(config["Master"]))
return
else:
incUsage("key")
return
else:
incUsage("key")
return
elif cmd == "add":
if length == 6:

Loading…
Cancel
Save