MessagePayload

@JsonClass(generateAdapter = true)
class MessagePayload(val id: String, val abstractMessage: Message, val messageReason: MessageReason? = null, val identifier: String = id, val wasRevised: Boolean? = null) : Message, EntryPayload

A message sent by a participant in the conversation.

Implements Message, so message properties (format, content components, language) are accessible directly on this payload instance.

See also

Samples

val payload = entry.payload as? EntryPayload.MessagePayload ?: return
when (val content = payload.content) {
    is StaticContentFormat.TextFormat -> displayText(content.text)
    is StaticContentFormat.AttachmentsFormat -> displayAttachments(content.attachments)
    else -> displayFallback()
}

Constructors

Link copied to clipboard
constructor(id: String, abstractMessage: Message, messageReason: MessageReason? = null, identifier: String = id, wasRevised: Boolean? = null)

Properties

Link copied to clipboard
Link copied to clipboard

The channel address identifier for routing purposes.

Link copied to clipboard
open override val content: MessageFormat

The formatted content of this message.

Link copied to clipboard

Context entries attached to this message for pre-chat or hidden fields.

Link copied to clipboard

The type discriminator indicating which kind of payload this entry contains.

Link copied to clipboard
open override val id: String

The unique identifier of this message.

Link copied to clipboard
Link copied to clipboard
open override val inReplyToMessageId: String?

The identifier of the message this is replying to, or null if not a reply.

Link copied to clipboard

Whether this message initiates a new messaging session.

Link copied to clipboard
open override var language: String?

The BCP 47 language tag for this message.

Link copied to clipboard
Link copied to clipboard

The structural type of this message, determining how content should be interpreted.

Link copied to clipboard
open override val reply: Message?

The original message being replied to, if this is a reply.

Link copied to clipboard
open override var routingAttributes: Map<String, Any>?

Key-value pairs used for skill-based routing decisions.

Link copied to clipboard