示例#1
0
 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])
示例#2
0
 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])
示例#3
0
文件: irc.mod.py 项目: s0lder/pibot
 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])