def join_handler(self, event, args): nick = irc.raw_nick(irc.parse_nick(args[0])) chan = args[2][0] if chan in self.channels: if nick not in self.channels[chan]: self.channels[chan].append(nick) self.mgr.handle_event(events.JOIN, [nick, chan])
def part_handler(self, event, args): nick = irc.raw_nick(irc.parse_nick(args[0])[0]) chan = args[2][0] if chan in self.channels: if nick in self.channels[chan]: self.channels[chan].remove(nick) self.mgr.handle_event(events.PART, [nick, chan])
def d_privmsg(self, event, args): source = irc.parse_nick(args[0])[0] target = args[2][0] msg = args[2][1] self.manager.handle_event(events.PRIVMSG, [source, target, msg])