def parse(self, message): print "in irc bot parse\n" if not message: return message = string.split(message, "\n") for line in message: line = string.rstrip(line) print line line = string.split(line) try: if line[0] == "PING": irc.serverMessage("PONG %s" % line[1]) elif line[4] == ":End": self.loggedOn = True if self.loggedOn: message = irc.linkParse(line) if message: self.UDPSock.send("**IRC**"+message) except IndexError: pass return True
def IRCconnect(server, port, nick): ident = nick host = nick realname = nick IRCSock.connect((server, port)) irc.serverMessage("NICK %s" % nick) irc.serverMessage("USER %s %s bla :%s" % (ident, host, realname)) return True