Add control-socket to bot.conf.example, only start up control socket is a unix

domain socket location is provided
This commit is contained in:
jesopo 2018-10-06 18:31:00 +01:00
parent 69eda4bf1b
commit 825fb15c87
2 changed files with 8 additions and 5 deletions

View file

@ -3,6 +3,8 @@ tls-key =
tls-certificate = tls-certificate =
tls-api-key = tls-api-key =
tls-api-certificate = tls-api-certificate =
# unix domain socket location for ControlSocket
control-socket =
# https://openweathermap.org/api # https://openweathermap.org/api
openweathermap-api-key = openweathermap-api-key =
# https://products.wolframalpha.com/api/ # https://products.wolframalpha.com/api/

View file

@ -23,9 +23,10 @@ class Bot(object):
self.servers = {} self.servers = {}
self.other_sockets = {} self.other_sockets = {}
if "contorl-socket" in self.config:
self.control_socket = ControlSocket.ControlSocket(self) self.control_socket = ControlSocket.ControlSocket(self)
self.add_socket(self.control_socket) self.add_socket(self.control_socket)
self._control_sclient = socket.socket( self._control_sclient = socket.socket(
socket.AF_UNIX, socket.SOCK_STREAM) socket.AF_UNIX, socket.SOCK_STREAM)
self._control_client.connect(self.config["control-socket"]) self._control_client.connect(self.config["control-socket"])