def irc_PRIVMSG(self, prefix, params): # You can only PRIVMSG NickServ while identifying if params and self.auth_timer is not None and irc_lower(params[0]) != "nickserv": self.sendMessage("NOTICE", ":You can not PRIVMSG anybody but NickServ while identifying a registered nick.", prefix=self.service_prefix("NickServ")) return if len(params) > 1 and irc_lower(params[0]) in self.services: service = irc_lower(params[0]) command, chaff, params = params[1].partition(" ") params = filter(lambda x: x, params.split(" ")) method = getattr(self, "{}_{}".format(service, command.upper()), None) if method is None: method = getattr(self, "{}_USAGE".format(service), None) method(prefix, params, command) else: method(prefix, params) else: IRCUser.irc_PRIVMSG(self, prefix, params)