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.
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
7 years ago
|
import main
|
||
7 years ago
|
|
||
6 years ago
|
class Del:
|
||
|
def __init__(self, *args):
|
||
|
self.delete(*args)
|
||
7 years ago
|
|
||
|
def delete(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||
|
if authed:
|
||
|
if length == 2:
|
||
7 years ago
|
if not spl[1] in main.pool.keys():
|
||
7 years ago
|
failure("Name does not exist: %s" % spl[1])
|
||
|
return
|
||
6 years ago
|
del main.pool[spl[1]]
|
||
7 years ago
|
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]]
|
||
6 years ago
|
success("Successfully removed bot: %s" % spl[1])
|
||
7 years ago
|
main.saveConf("pool")
|
||
7 years ago
|
return
|
||
|
else:
|
||
|
incUsage("del")
|
||
|
return
|
||
|
else:
|
||
|
incUsage(None)
|