awaitRepliesAsState

suspend fun ChatClient.awaitRepliesAsState(messageId: String, messageLimit: Int, olderToNewer: Boolean): ThreadState

Returns thread replies in the form of ThreadState, however, unlike getRepliesAsState it will return it only after the API call made to get replies has ended. Thread state will be returned regardless if the API call has succeeded or failed, the only difference is in how up to date the replies in the thread state are.

Return

ThreadState wrapped inside a Call.

Parameters

messageId

The ID of the original message the replies were made to.

messageLimit

The number of messages that will be initially loaded.

olderToNewer

The flag that determines the order of the messages.

coroutineScope

The CoroutineScope used for executing the request.