<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def changeNickname( self, nickname, user_id, thread_id=None, thread_type=ThreadType.USER ):
 """ Changes the nickname of a user in a thread :param nickname: New nickname :param user_id: User that will have their nickname changed :param thread_id: User/Group ID to change color of. See :ref:`intro_threads` :param thread_type: See :ref:`intro_threads` :type thread_type: models.ThreadType :raises: FBchatException if request failed """

        thread_id, thread_type = self._getThread(thread_id, thread_type)

        data = {
            "nickname": nickname,
            "participant_id": user_id,
            "thread_or_other_fbid": thread_id,
        }
        j = self._post(
            self.req_url.THREAD_NICKNAME, data, fix_request=True, as_json=True
        )