def irc_NICK(self, prefix, params):
        """Nick message -- Set your nickname.

        Parameters: <nickname>

        [REQUIRED]
        """
        try:
            nickname = params[0].decode(self.encoding)
        except UnicodeDecodeError:
            self.privmsg(
                NICKSERV,
                nickname,
                'Your nickname is cannot be decoded.  Please use ASCII or UTF-8.')
            self.transport.loseConnection()
            return

        self.nickname = nickname
        self.name = nickname

        for code, text in self._motdMessages:
            self.sendMessage(code, text % self.factory._serverInfo)

        if self.password is None:
            self.privmsg(
                NICKSERV,
                nickname,
                'Password?')
        else:
            password = self.password
            self.password = None
            self.logInAs(nickname, password)
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/service.py/IRCUser.irc_NICK/original