Options
All
  • Public
  • Public/Protected
  • All
Menu

Thread contains the APIs for thread operations.

Index

Functions

  • Changes the message thread name.

    connection.changeChatThreadName({chatThreadId: 'chatThreadId',name: 'name'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string; name: string }
      • chatThreadId: string

        The message thread ID.

      • name: string

        The message thread name.

    Returns Promise<AsyncResult<ChangeChatThreadName>>

  • Creates a message thread.

    connection.createChatThread({parentId: 'parentId',name: 'threadName',messageId: 'messageId'})
    

    Parameters

    • this: Connection
    • params: { messageId: string; name: string; parentId: string }
      • messageId: string

        The ID of the parent message.

      • name: string

        The name of the new message thread.

      • parentId: string

        The group ID to which the message thread belongs.

    Returns Promise<AsyncResult<CreateChatThreadResult>>

  • destroyChatThread(this: Connection, params: { chatThreadId: string }): Promise<void>
  • Destroy the message thread.

    Only the owner and admins of the group to which the message thread belongs can call this method.

    connection.destroyChatThread({chatThreadId: 'chatThreadId'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string }
      • chatThreadId: string

        The ID of the message thread to delete.

    Returns Promise<void>

  • Gets the details of the message thread.

    connection.getChatThreadDetail({chatThreadId: 'chatThreadId'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string }
      • chatThreadId: string

        The message thread ID.

    Returns Promise<AsyncResult<ChatThreadDetail>>

  • Gets the last threaded reply in the specified message threads.

    connection.getChatThreadLastMessage({chatThreadIds: ['chatThreadId1','chatThreadId2']})
    

    Parameters

    • this: Connection
    • params: { chatThreadIds: string[] }
      • chatThreadIds: string[]

        The array of message thread IDs to query. You can pass a maximum of 20 message thread IDs each time.

    Returns Promise<AsyncResult<ChatThreadLastMessage>>

  • Gets members in the message thread with pagination.

    connection.getChatThreadMembers({chatThreadId: 'chatThreadId',pageSize:20,cursor:'cursor'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string; cursor?: string; pageSize?: number }
      • chatThreadId: string

        The message thread ID.

      • Optional cursor?: string

        The position from which to start getting data. At the first method call, if you set cursor to an empty string, the SDK will get data in the chronological order of when members join the message thread.

      • Optional pageSize?: number

        The number of members that you expect to get on each page. The value range is [1,50] and the default value is 20.

    Returns Promise<AsyncResult<ChatThreadMembers>>

  • Use the pagination to get the list of message threads that the current user has joined in the specified group.

    connection.getChatThreads({parentId: 'parentId, cursor:'cursor' ,pageSize: 50})
    

    Parameters

    • this: Connection
    • params: { cursor?: string; pageSize?: number; parentId: string }
      • Optional cursor?: string

        The position from which to start getting data. At the first method call, if you set cursor to an empty string, the SDK will get data in the reverse chronological order of when the user joins the message threads.

      • Optional pageSize?: number

        The number of message threads that you expect to get on each page. The value range is [1,50] and the default value is 20.

      • parentId: string

        The group ID to which the message thread belongs.

    Returns Promise<AsyncResult<ChatThreadDetail[]>>

  • Uses the pagination to get the message threads that the current user has joined.

    connection.getJoinedChatThreads({parentId: 'parentId',cursor: 'cursor',pageSize: 50})
    

    Parameters

    • this: Connection
    • params: { cursor?: string; pageSize?: number; parentId?: string }
      • Optional cursor?: string

        The position from which to start getting data. At the first method call, if you set cursor to an empty string, the SDK will get data in the reverse chronological order of when the user joins the message threads.

      • Optional pageSize?: number

        The number of message threads that you expect to get on each page. The value range is [1,50] and the default value is 20.

      • Optional parentId?: string

        The group ID to which the message thread belongs. If this parameter is set, the SDK returns the message threads that the current user has joined in a specified group.

    Returns Promise<AsyncResult<ChatThreadDetail[]>>

  • Joins a message thread.

    connection.joinChatThread({chatThreadId: 'chatThreadId'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string }
      • chatThreadId: string

        The message thread ID.

    Returns Promise<AsyncResult<JoinChatThreadResult>>

  • leaveChatThread(this: Connection, params: { chatThreadId: string }): Promise<void>
  • Leaves the message thread.

    connection.leaveChatThread({chatThreadId: 'chatThreadId'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string }
      • chatThreadId: string

        The ID of the message thread that the current user wants to leave.

    Returns Promise<void>

  • Removes a member from the message thread.

    connection.removeChatThreadMember({chatThreadId: 'chatThreadId',username:'username'})
    

    Parameters

    • this: Connection
    • params: { chatThreadId: string; username: string }
      • chatThreadId: string

        The message thread ID.

      • username: string

        The user ID of the member to remove.

    Returns Promise<AsyncResult<RemoveMemberResult>>

Generated using TypeDoc