def process_line(self, ircmsg): if is_ping(ircmsg): logger.incoming_ping(ircmsg) pingmsg = ircmsg.split("PING :")[1] self.send("PONG :" + pingmsg + "\n") elif is_message(ircmsg): logger.log(ircmsg) self.process_message(ircmsg) else: logger.incoming_info(ircmsg) # weird hack thing for joining channels? if "End of /MOTD" in ircmsg: for channel in self.channels: self.joinchan(channel) # weird hack thing for nickserv identify if "[email protected]" in ircmsg: if "You are already identified." not in ircmsg: self.sendmsg("NickServ", "IDENTIFY " + self.password)
def send(self, line): if is_message(line): message = Message(line) print("-->", message.text, end="") else: print("###", line, end="")