def irc_NICKSERV_PRIVMSG(self, prefix, params):
        """
        Send a (private) message.

        Parameters: <msgtarget> <text to be sent>
        """
        target = params[0]
        password = params[-1]

        if self.nickname is None:
            # XXX Send an error response here
            self.transport.loseConnection()
        elif target.lower() != "nickserv":
            self.privmsg(
                NICKSERV,
                self.nickname,
                "Denied.  Please send me (NickServ) your password.")
        else:
            nickname = self.nickname
            self.nickname = None
            self.logInAs(nickname, password)

        Send a (private) message.

        Parameters: <msgtarget> <text to be sent>
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/words/service.py