You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
851 B
Python

import main
import core.helper as helper
class Enable:
def __init__(self, register):
register("enable", self.enable)
def enable(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
if authed:
if length == 2:
if not spl[1] in main.pool.keys():
failure("Name does not exist: %s" % spl[1])
return
main.pool[spl[1]]["enabled"] = True
main.saveConf("pool")
if not spl[1] in main.IRCPool.keys():
helper.addBot(spl[1])
else:
pass
success("Successfully enabled bot %s" % spl[1])
return
else:
incUsage("enable")
return
else:
incUsage(None)