diff --git a/threshold b/threshold index f87a78f..59dfebd 100755 --- a/threshold +++ b/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