sendMessage

suspend fun Conversation.sendMessage(message: String, parentMessageId: MessageId? = null): AxpResult<Message>

Sends a message in the session.

Return

AxpResult containing the result of the operation. This will be an AxpSuccessResult if the message is sent successfully, or an AxpFailureResult if an error occurs.

Parameters

message

The message text to send. This must be a valid string.

parentMessageId

The ID of the parent message if applicable. This is optional.


fun Conversation.sendMessage(message: String, parentMessageId: MessageId? = null, responseHandler: ResponseHandler<Message>)

Sends a message in the session asynchronously with a response handler.

Parameters

message

The message text to send. This must be a valid string.

parentMessageId

The ID of the parent message if applicable. This is optional.

responseHandler

The response handler for asynchronous processing. This handler will be called with the result of the operation.


suspend fun Conversation.sendMessage(message: MessageBody, parentMessageId: MessageId? = null): AxpResult<Message>

Sends a message in the conversation.

This is a suspending function that sends a message in the conversation. The message is represented by a MessageBody object.

Return

AxpResult containing the result of the operation. This will be an AxpSuccessResult if the message is sent successfully, or an AxpFailureResult if an error occurs.

Parameters

message

The message to send. This must be a valid MessageBody object.

parentMessageId

The ID of the parent message if applicable. This is optional.


fun Conversation.sendMessage(message: MessageBody, responseHandler: ResponseHandler<Message>, parentMessageId: MessageId? = null)

Sends a message in the conversation asynchronously.

This function sends a message in the conversation asynchronously. The message is represented by a MessageBody object. The result of the operation is handled by a ResponseHandler.

Parameters

message

The message to send. This must be a valid MessageBody object.

responseHandler

The response handler for asynchronous processing. This handler will be called with the result of the operation.

parentMessageId

The ID of the parent message if applicable. This is optional.

Throws

if the given inputs are not valid.

SessionNotFound

if the session is not found.