Renovate the module system and implement adding and resuming pool instances using the new relay/alias/network system

This commit is contained in:
2019-01-26 18:58:21 +00:00
parent 4efea3f535
commit 8926cb76ec
37 changed files with 184 additions and 302 deletions

29
commands/del.py Normal file
View File

@@ -0,0 +1,29 @@
import main
class Del:
def __init__(self, *args):
self.delete(*args)
def delete(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
del main.pool[spl[1]]
if spl[1] in main.ReactorPool.keys():
if spl[1] in main.FactoryPool.keys():
main.FactoryPool[spl[1]].stopTrying()
main.ReactorPool[spl[1]].disconnect()
if spl[1] in main.IRCPool.keys():
del main.IRCPool[spl[1]]
del main.ReactorPool[spl[1]]
del main.FactoryPool[spl[1]]
success("Successfully removed bot: %s" % spl[1])
main.saveConf("pool")
return
else:
incUsage("del")
return
else:
incUsage(None)