Skip to main content

Properties

Attachment[]
required
Type: AttachmentAttachments
required
Message author
required
Structured formatting as an AST (mdast Root). This is the canonical representation - use this for processing. Use stringifyMarkdown(message.formatted) to get markdown string.
string
required
Unique message ID
boolean
Whether the bot is @-mentioned in this message.Populated by the Chat SDK before handlers run. An adapter that reads the platform’s own mention metadata reports true or false; the SDK falls back to matching @username in the message text (using the adapter’s configured userName and optional botUserId) only when this is undefined.A definitive false wins over text that merely looks like a mention, such as @username inside a code sample or quoted text.One exception: a direct message received while no onDirectMessage handler is registered is always marked true, whatever the adapter reported, so it routes to onNewMention.
Type: LinkPreviewLinks found in the message
Message metadata
TRawMessage
required
Platform-specific raw payload (escape hatch)
Message<TRawMessage>
Type: MessageMessage this message replies to
string
required
Plain text content (all formatting stripped)
string
required
Thread this message belongs to
string
Cross-platform user key for this message’s author.Set by the Chat SDK before passing the message to handlers, when ChatConfig.identity is configured. undefined if no resolver is configured; undefined (i.e. absent) when the resolver returned null.Used by the Transcripts API to look up / append per-user transcripts.

Methods

addReaction()

Add a reaction to this message

Parameters

string | EmojiValue
required

Returns

Promise<void>

delete()

Delete this message

Returns

Promise<void>

edit()

Edit this message with text, a PostableMessage, or a JSX Card element

Parameters

Returns

SentMessage

removeReaction()

Remove a reaction from this message

Parameters

string | EmojiValue
required

Returns

Promise<void>

toJSON()

Serialize the message to a plain JSON object. Use this to pass message data to external systems like workflow engines. Note: Attachment data (Buffer) and fetchData (function) are omitted as they’re not serializable.

Returns

SerializedMessage