惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
D
Docker
有赞技术团队
有赞技术团队
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
H
Help Net Security
美团技术团队
MyScale Blog
MyScale Blog
B
Blog RSS Feed
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
G
Google Developers Blog
月光博客
月光博客
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs

Chat SDK Documentation

History | Chat SDK History | Chat SDK List a vendor-official adapter | Chat SDK Approvals | Chat SDK Vercel Connect | Chat SDK Teams Low-Level APIs | Chat SDK CLI | Chat SDK Platform Adapters | Chat SDK State Adapters | Chat SDK Cards | Chat SDK Getting Started | Chat SDK Introduction | Chat SDK Modals | Chat SDK Slack Low-Level APIs | Chat SDK Streaming | Chat SDK Testing | Chat SDK Overview | Chat SDK toAiMessages | Chat SDK Cards | Chat SDK Overview | Chat SDK Markdown | Chat SDK Modals | Chat SDK AI SDK Tools | Chat SDK Types | Chat SDK Message Subject | Chat SDK Conversation History | Chat SDK Transcripts | Chat SDK Slack bot with Next.js and Redis Actions | Chat SDK Direct Messages | Chat SDK
Message | Chat SDK
Author · 2026-04-06 · via Chat SDK Documentation

Normalized message format with text, AST, author, and metadata.

Incoming messages are normalized across all platforms into a consistent Message object.

import { Message } from "chat";

How isMe works

Each adapter detects whether a message came from the bot itself. The detection logic varies by platform:

PlatformDetection method
SlackChecks event.user === botUserId (primary), then event.bot_id === botId (for bot_message subtypes). Both IDs are fetched during initialization via auth.test.
TeamsChecks activity.from.id === appId (exact match), then checks if activity.from.id ends with :{appId} (handles 28:{appId} format).
Google ChatChecks message.sender.name === botUserId. The bot user ID is learned dynamically from message annotations when the bot is first @-mentioned.

All adapters return false if the bot ID isn't known yet. This is a safe default that prevents the bot from ignoring messages it should process.

Links found in incoming messages are extracted and exposed as LinkPreview objects. On platforms that support it (currently Slack), links pointing to other chat messages include a fetchMessage() callback to retrieve the full linked message.

When using toAiMessages(), link metadata is automatically appended to the message content. Embedded message links are labeled as [Embedded message: ...] so the AI model understands the context.

Platform support

PlatformLink extractionfetchMessage()
SlackURLs from rich_text blocks or <url> text patternsSlack message links (*.slack.com/archives/...)
OthersNot yet — links is always []

Returned by message.subject on platforms with parent resources. See Message Subject for usage.

Messages can be serialized for workflow engines and external systems.

// Serialize
const json = message.toJSON();

// Deserialize
const restored = Message.fromJSON(json);

The serialized format converts Date fields to ISO strings and omits non-serializable fields like data buffers and fetchData functions. The fetchMetadata field is preserved so that adapters can reconstruct fetchData when the message is rehydrated from a queue.