Renovate the module system and implement adding and resuming pool instances using the new relay/alias/network system
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import main
|
||||
import core.helper as helper
|
||||
from core.helper import startBot
|
||||
from core.bot import deliverRelayCommands
|
||||
|
||||
class Enable:
|
||||
def __init__(self, register):
|
||||
register("enable", self.enable)
|
||||
def __init__(self, *args):
|
||||
self.enable(*args)
|
||||
|
||||
def enable(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||
if authed:
|
||||
@@ -12,9 +13,14 @@ class Enable:
|
||||
failure("Name does not exist: %s" % spl[1])
|
||||
return
|
||||
main.pool[spl[1]]["enabled"] = True
|
||||
user = main.pool[spl[1]]["alias"]
|
||||
network = main.pool[spl[1]]["network"]
|
||||
relay = main.pool[spl[1]]["relay"]
|
||||
commands = {"status": ["Connect"]}
|
||||
deliverRelayCommands(relay, commands, user=user+"/"+network)
|
||||
main.saveConf("pool")
|
||||
if not spl[1] in main.IRCPool.keys():
|
||||
helper.addBot(spl[1])
|
||||
startBot(spl[1])
|
||||
else:
|
||||
pass
|
||||
success("Successfully enabled bot %s" % spl[1])
|
||||
|
||||
Reference in New Issue
Block a user