send File Messages Flow
fun BaseChannel.sendFileMessagesFlow(paramsList: List<FileMessageCreateParams>): Flow<MultipleMessagesResult<FileMessage>>
Send file messages
channel.sendFileMessagesFlow(paramsList)
.onEach {
when (it) {
is MultipleMessagesResult.Pending -> {
// called it when sending file messages are started
// it contains pendingMessageList
}
is MultipleMessagesResult.EachSucceed -> {
// each file sending completed
// it.message is a succeeded file message
}
is MultipleMessagesResult.EachFailure -> {
// each file sending failed
// it.failedMessage is a failed file message
// it.e is a cause of failure
}
}
}.catch {
// called it when request failed (validation failure)
}.onCompletion {
// called it when all all file messages are completed
}.launchIn(viewModelScope)
Content copied to clipboard
Return
The file messages result
Since
4.17.0
Parameters
params List
List of params of file message. Refer to FileMessageCreateParams. Null is ignored
See also
File Message Create Params