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:
parent
69eda4bf1b
commit
825fb15c87
2 changed files with 8 additions and 5 deletions
|
@ -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/
|
||||||
|
|
|
@ -23,12 +23,13 @@ class Bot(object):
|
||||||
|
|
||||||
self.servers = {}
|
self.servers = {}
|
||||||
self.other_sockets = {}
|
self.other_sockets = {}
|
||||||
self.control_socket = ControlSocket.ControlSocket(self)
|
|
||||||
self.add_socket(self.control_socket)
|
|
||||||
|
|
||||||
self._control_sclient = socket.socket(
|
if "contorl-socket" in self.config:
|
||||||
socket.AF_UNIX, socket.SOCK_STREAM)
|
self.control_socket = ControlSocket.ControlSocket(self)
|
||||||
self._control_client.connect(self.config["control-socket"])
|
self.add_socket(self.control_socket)
|
||||||
|
self._control_sclient = socket.socket(
|
||||||
|
socket.AF_UNIX, socket.SOCK_STREAM)
|
||||||
|
self._control_client.connect(self.config["control-socket"])
|
||||||
|
|
||||||
def trigger(self):
|
def trigger(self):
|
||||||
self._control_client.send(b"TRIGGER")
|
self._control_client.send(b"TRIGGER")
|
||||||
|
|
Loading…
Reference in a new issue