original_docstring: 
          Run the real-time chat
  
          Parameters
          ----------
          user_id: str
              The target user's id
          callback: function
              The callback function that called
              when the message is arrived
          
docstring: Run the real-time chat
  Parameters
  
  str
  The target user's id
  callback: function
  The callback function that called
  when the message is arrived
docstring_tokens: Run the real - time chat Parameters str The target user ' s id callback : function The callback function that called when the message is arrived
code: def run(
          self,
          user_id: str,
          callback: type(lambda msg: print) = __on_message
      ):
          """
          Run the real-time chat
  
          Parameters
          ----------
          user_id: str
              The target user's id
          callback: function
              The callback function that called
              when the message is arrived
          """
  
          try:
              self.__clear_console()
              cursor.hide()
          except:
              pass
  
          # cache call parameters in order to reconnect
          self.__cached_user_id = user_id
          self.__cached_callback = callback
  
          self.__log(f"retriving live video id...")
          # video id is necessary to get event pub-sub socket address
          video_id = twitcasting.get_video_id(user_id)
          self.__log(f"got live video id {video_id}")
  
          # get event pub-sub socket address
          sock_address = twitcasting.get_event_pubsub_url(video_id)
  
          self.__ws = websocket.WebSocketApp(
              sock_address,
              on_open = self.__on_open,
              on_message = self.__on_message,
              on_error = self.__on_error,
              on_close = self.__on_close,
          )
  
          try:
              self.__set_terminal_title(f"twcs_realtime_chat ({video_id})")
          except:
              pass
  
          self.__ws.run_forever()
code_tokens: def run ( self , user_id : str , callback : type ( lambda msg : print ) = __on_message ) : try : self . __clear_console ( ) cursor . hide ( ) except : pass self . __cached_user_id = user_id self . __cached_callback = callback self . __log ( f"retriving live video id..." ) video_id = twitcasting . get_video_id ( user_id ) self . __log ( f"got live video id {video_id}" ) sock_address = twitcasting . get_event_pubsub_url ( video_id ) self . __ws = websocket . WebSocketApp ( sock_address , on_open = self . __on_open , on_message = self . __on_message , on_error = self . __on_error , on_close = self . __on_close , ) try : self . __set_terminal_title ( f"twcs_realtime_chat ({video_id})" ) except : pass self . __ws . run_forever ( )
short_docstring: Run the real-time chat
  Parameters
short_docstring_tokens: Run the real - time chat Parameters
comment: """
          Run the real-time chat
  
          Parameters
          ----------
          user_id: str
              The target user's id
          callback: function
              The callback function that called
              when the message is arrived
          """$SEP$# cache call parameters in order to reconnect$SEP$# video id is necessary to get event pub-sub socket address$SEP$# get event pub-sub socket address