exit when all servers are disconnected after ctrl+c

This commit is contained in:
jesopo 2019-10-11 17:06:37 +01:00
parent 934a5ec9ea
commit 3fc7294539

View file

@ -35,7 +35,11 @@ class Module(ModuleManager.BaseModule):
sys.exit() sys.exit()
def _make_hook(self, server): def _make_hook(self, server):
return lambda e: self.bot.disconnect(server) return lambda e: self._disconnect_hook(server)
def _disconnect_hook(self, server):
self.bot.disconnect(server)
if not self.bot.servers:
sys.exit()
def SIGUSR1(self, signum, frame): def SIGUSR1(self, signum, frame):
self.bot.trigger(self._reload_config) self.bot.trigger(self._reload_config)