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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
H
Help Net Security
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
V
V2EX
M
MIT News - Artificial intelligence
Vercel News
Vercel News
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
D
Docker
V
Visual Studio Blog
博客园 - 叶小钗
美团技术团队
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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.