send

js
suspend fun send(recipient: Recipient, messageBody: String, attachments: Iterable<<ERROR CLASS>> = emptyList(), quote: <ERROR CLASS>? = null, mentions: Iterable<<ERROR CLASS>> = emptyList(), timestamp: Long = Clock.System.now().toEpochMilliseconds()): <ERROR CLASS>

Sends a message to either a single user (Recipient.Individual) or a group (Recipient.Group).

Parameters

recipient

The recipient that will receive our message. If sending to a group, note that signald will handle the fan-out of messages to all users.

messageBody

The body of the message.

attachments

Attachments to include in the message.

quote

A quote to include in the message, where the quote refers to a previous message.

mentions

Mentions to include in the message. Typically, an empty space is used as the mention placeholder, and then the position of the empty space is referred to by the JsonMention.start property.

timestamp

The timestamp of the message that we are sending. Default to the current system clock time.

Throws

RequestFailedException

if signald sends an error response or the incoming message is invalid

SignaldException

if the request to the socket fails

synchronousClient
fun send(recipient: Recipient, messageBody: String, attachments: Iterable<JsonAttachment> = emptyList(), quote: JsonQuote? = null, mentions: Iterable<JsonMention> = emptyList(), timestamp: Long = Clock.System.now().toEpochMilliseconds()): SendResponse

Sends a message to either a single user (Recipient.Individual) or a group (Recipient.Group).

Parameters

recipient

The recipient that will receive our message. If sending to a group, note that signald will handle the fan-out of messages to all users.

messageBody

The body of the message.

attachments

Attachments to include in the message.

quote

A quote to include in the message, where the quote refers to a previous message.

mentions

Mentions to include in the message. Typically, an empty space is used as the mention placeholder, and then the position of the empty space is referred to by the JsonMention.start property.

timestamp

The timestamp of the message that we are sending. Default to the current system clock time.

Throws

org.inthewaves.kotlinsignald.clientprotocol.RequestFailedException

if signald sends an error response or the incoming message is invalid

org.inthewaves.kotlinsignald.clientprotocol.SignaldException

if the request to the socket fails