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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Vercel News
Vercel News
F
Fortinet All Blogs
月光博客
月光博客
G
Google Developers Blog
博客园 - Franky
GbyAI
GbyAI
The Cloudflare Blog
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
小众软件
小众软件
腾讯CDC
B
Blog
量子位
V
V2EX
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News

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
Channel | Chat SDK
Vercel · 2026-04-06 · via Chat SDK Documentation

Channel container that holds threads, with methods for listing, posting, and iteration.

A Channel represents a channel or conversation container that holds threads. Both Thread and Channel extend the shared Postable interface, so they share common methods like post(), state, and messages.

Get a channel via thread.channel or chat.channel():

// Navigate from a thread
const channel = thread.channel;

// Get directly by ID
const channel = chat.channel("slack:C123ABC");

Channel IDs are derived from thread IDs by dropping the thread-specific part. By default, this is the first two colon-separated segments:

PlatformThread IDChannel ID
Slackslack:C123ABC:1234567890.123456slack:C123ABC
Teamsteams:{base64}:{base64}teams:{base64}
Google Chatgchat:spaces/ABC123:{base64}gchat:spaces/ABC123
Discorddiscord:{guildId}:{channelId}/{messageId}discord:{guildId}

Iterate channel-level messages (top-level, not thread replies) newest first. Auto-paginates lazily.

for await (const msg of channel.messages) {
  console.log(msg.text);
}

Iterate threads in the channel, most recently active first. Returns lightweight ThreadSummary objects.

for await (const thread of channel.threads()) {
  console.log(thread.rootMessage.text, thread.replyCount);
}

ThreadSummary

post

Post a message to the channel top-level (not in a thread).

await channel.post("Hello channel!");
await channel.post({ markdown: "**Announcement**: New release!" });

Accepts the same message formats as thread.post() — see PostableMessage.

Schedule a message for future delivery to the channel top-level. Currently only supported by the Slack adapter — other adapters throw NotImplementedError.

const scheduled = await channel.schedule("Weekly reminder: update your status!", {
  postAt: new Date("2026-03-10T09:00:00Z"),
});

// Cancel before it's sent
await scheduled.cancel();

Accepts the same message formats as channel.post() (except streaming). See ScheduledMessage for the return type.

Fetch channel metadata from the platform.

const info = await channel.fetchMetadata();
console.log(info.name, info.memberCount);

ChannelInfo

Store typed, per-channel state. Works the same as thread state with a 30-day TTL.

const state = await channel.state;
await channel.setState({ lastAnnouncement: new Date().toISOString() });

postEphemeral

Post a message visible only to a specific user.

await channel.postEphemeral(userId, "Only you can see this", {
  fallbackToDM: true,
});

Show a typing indicator. No-op on platforms that don't support it. On Slack, you can pass an optional status string to show a custom loading message (requires assistant:write scope).

await channel.startTyping();

// With custom status (Slack only)
await channel.startTyping("Searching documents...");

Get a platform-specific @-mention string.

await channel.post(`Hey ${channel.mentionUser(userId)}, check this out!`);