Constructor
Parameters
MessageData<TRawMessage>
required
Type:
MessageDataReturns
Message
Properties
Attachment[]
required
Type:
AttachmentAttachmentsStructured 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.LinkPreview[]
required
Type:
LinkPreviewLinks found in the messagerequired
Message metadata
TRawMessage
required
Platform-specific raw payload (escape hatch)
Promise<MessageSubject | null>
required
Type:
MessageSubjectstring
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
WORKFLOW_DESERIALIZE
Parameters
required
Returns
Message
WORKFLOW_SERIALIZE
Parameters
Returns
SerializedMessage
fromJSON()
Parameters
required
Returns
Message
toJSON()
data (Buffer) and fetchData (function) are omitted
as they’re not serializable.
Returns
SerializedMessage