Additional checks when disabling or deleting bots
This commit is contained in:
parent
aacb50d5d2
commit
57e54cbced
15
threshold
15
threshold
|
@ -670,7 +670,8 @@ class Helper(object):
|
|||
if spl[1] in FactoryPool.keys():
|
||||
FactoryPool[spl[1]].stopTrying()
|
||||
ReactorPool[spl[1]].disconnect()
|
||||
del IRCPool[spl[1]]
|
||||
if spl[1] in IRCPool.keys():
|
||||
del IRCPool[spl[1]]
|
||||
del ReactorPool[spl[1]]
|
||||
del FactoryPool[spl[1]]
|
||||
success("Successfully disabled bot %s" % spl[1])
|
||||
|
@ -998,10 +999,14 @@ class Helper(object):
|
|||
failure("Name does not exist: %s" % spl[1])
|
||||
return
|
||||
del pool[spl[1]]
|
||||
if spl[1] in IRCPool.keys():
|
||||
if IRCPool[spl[1]].connected == True:
|
||||
IRCPool[spl[1]].transport.loseConnection()
|
||||
del IRCPool[spl[1]]
|
||||
if spl[1] in ReactorPool.keys():
|
||||
if spl[1] in FactoryPool.keys():
|
||||
FactoryPool[spl[1]].stopTrying()
|
||||
ReactorPool[spl[1]].disconnect()
|
||||
if spl[1] in IRCPool.keys():
|
||||
del IRCPool[spl[1]]
|
||||
del ReactorPool[spl[1]]
|
||||
del FactoryPool[spl[1]]
|
||||
success("Successfully removed bot")
|
||||
self.save("pool")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue