diff --git a/bot.conf.example b/bot.conf.example index 5914d822..3595c67e 100644 --- a/bot.conf.example +++ b/bot.conf.example @@ -3,6 +3,8 @@ tls-key = tls-certificate = tls-api-key = tls-api-certificate = +# unix domain socket location for ControlSocket +control-socket = # https://openweathermap.org/api openweathermap-api-key = # https://products.wolframalpha.com/api/ diff --git a/src/IRCBot.py b/src/IRCBot.py index 47fc22eb..d9f14c74 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -23,12 +23,13 @@ class Bot(object): self.servers = {} self.other_sockets = {} - self.control_socket = ControlSocket.ControlSocket(self) - 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"]) + if "contorl-socket" in self.config: + self.control_socket = ControlSocket.ControlSocket(self) + 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): self._control_client.send(b"TRIGGER")