diff --git a/modules/github.py b/modules/github.py index 789b8c00..ab5744b2 100644 --- a/modules/github.py +++ b/modules/github.py @@ -41,4 +41,4 @@ class Module(ModuleManager.BaseModule): self.events.on("send.stdout").call(target=channel, module_name="Github", server=server, message=line) - self.bot.register_both(server) + self.bot.trigger() diff --git a/src/IRCBot.py b/src/IRCBot.py index 29c45b9b..fb8533fc 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -1,4 +1,4 @@ -import os, select, sys, threading, time, traceback, uuid +import os, select, socket, sys, threading, time, traceback, uuid from src import ControlSocket, EventManager, Exports, IRCServer, Logging from src import ModuleManager, utils @@ -26,6 +26,13 @@ class Bot(object): self.control_socket = ControlSocket.ControlSocket(self) self.add_socket(self.control_socket) + self.control_socket_client = socket.socket( + socket.AF_UNIX, socket.SOCK_STREAM) + self.control_socket_client.connect(self.config["control-socket"]) + + def trigger(self): + self.control_socket_client.send(b"TRIGGER") + def add_server(self, server_id, connect=True): (_, alias, hostname, port, password, ipv4, tls, bindhost, nickname, username, realname) = self.database.servers.get(server_id)