Separate out everything into files and implement a modules system to segment commands
This commit is contained in:
26
commands/enable.py
Normal file
26
commands/enable.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from core.main import *
|
||||
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 pool.keys():
|
||||
failure("Name does not exist: %s" % spl[1])
|
||||
return
|
||||
pool[spl[1]]["enabled"] = True
|
||||
saveConf("pool")
|
||||
if not spl[1] in IRCPool.keys():
|
||||
helper.addBot(spl[1])
|
||||
else:
|
||||
pass
|
||||
success("Successfully enabled bot %s" % spl[1])
|
||||
return
|
||||
else:
|
||||
incUsage("enable")
|
||||
return
|
||||
else:
|
||||
incUsage(None)
|
||||
Reference in New Issue
Block a user