Esempio n. 1
0
 def lineReceived(self, line): # use instead of query
     line = irc.lowDequote(line)
     try:
         prefix, command, params = irc.parsemsg(line)
         if irc.numeric_to_symbolic.has_key(command):
             command = irc.numeric_to_symbolic[command]
         self.handleCommand(command, prefix, params)
     except irc.IRCBadMessage:
         self.badMessage(line, *sys.exc_info())
     try:
         if command == "RPL_NAMREPLY":
             names = params[3].split()
             for name in names:
                 if name.startswith("@"):
                     self.ops.append(name[1:])
     except:
         logging.log(logging.ERROR, traceback.format_exc())
Esempio n. 2
0
 def lineReceived(self, line): # use instead of query
     line = irc.lowDequote(line)
     try:
         prefix, command, params = irc.parsemsg(line)
         if irc.numeric_to_symbolic.has_key(command):
             command = irc.numeric_to_symbolic[command]
         self.handleCommand(command, prefix, params)
     except irc.IRCBadMessage:
         self.badMessage(line, *sys.exc_info())
     try:
         if command == "RPL_NAMREPLY":
             names = params[3].split()
             for name in names:
                 if name.startswith("@"):
                     actual_name = name[1:]
                     self.users[params[2].lower()].ops.add(actual_name)
                 elif name.startswith("+"):
                     actual_name = name[1:]
                     self.users[params[2].lower()].voice.add(actual_name)
                 else:
                     actual_name = name
                 self.users[params[2].lower()].all.add(actual_name)
     except:
         self.logger.error(traceback.format_exc())