kill bitbotctl connection after rehash

This commit is contained in:
jesopo 2019-10-11 15:58:47 +01:00
parent 0bdce04306
commit 85a8ddf2d1

View file

@ -87,14 +87,21 @@ class Control(PollSource.PollSource):
response_action = "ack"
response_data = None
keepalive = True
if command == "version":
client.version = int(data)
elif command == "log":
client.log_level = Logging.LEVELS[data.lower()]
elif command == "rehash":
self._bot.log.info("Reloading config file")
self._bot.config.load()
self._bot.log.info("Reloaded config file")
keepalive = False
self._send_action(client, response_action, response_data, id)
if not keepalive:
client.disconnect()
def _send_action(self, client: ControlClient, action: str, data: str,
id: int=None):