通过实际操作产品验证交付内容,记录用户可查看的证据,并发布验收报告。可检查已有验证计划或创建检查项,选择合适的操作界面,并使用 `lh` CLI 发布结果。
- 实际检查更改后的产品行为
- 收集截图或其他验证证据
- 编写验证计划和报告
使用 `chat` SDK 和 TypeScript 为多个聊天平台构建机器人,处理提及、斜杠命令、互动卡片、表单、Webhook 和流式回复。
Use for multi-platform bots built with chat SDK: webhooks, mentions, slash commands, cards, modals and streaming.
实测评分 未实测
查看安装方法使用 chat SDK,可以通过同一套 TypeScript 代码为多个聊天服务构建机器人。Slack、Teams、Google Chat、Discord、GitHub 和 Linear 等平台适配器支持机器人响应提及、斜杠命令、消息、表情回应和按钮操作。SDK 还支持向对话线程发消息、订阅线程、保存状态以及连接 Webhook。卡片中可以加入按钮和选择项,也可以将异步生成的文本逐步传送到聊天中。
希望在多个聊天服务中提供相同机器人功能,或开发能够响应对话内操作的机器人时,可以使用这套指南。需要加入表单、卡片审批等互动流程,或在 AI 回复生成过程中持续发送内容时也适用。
需要安装 chat 和相应的平台适配器包。开始实现前,请查看 node_modules/chat/docs/ 中的相关文档和类型定义。模态窗口的说明面向 Slack。
本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。
AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。
不计入评分。 由 AI(OpenAI Codex)于 2026年10月26日 评估。仅供参考,安装前请同时查看原文。
安装前可以查看交给 AI 代理的指令内容。
Unified TypeScript SDK for building chat bots across Slack, Teams, Google Chat, Discord, GitHub, and Linear. Write bot logic once, deploy everywhere.
The chat package ships with full documentation in node_modules/chat/docs/ and TypeScript source types. Always read these before writing code:
node_modules/chat/docs/ # Full documentation (MDX files)
node_modules/chat/dist/ # Built types (.d.ts files)
Key docs to read based on task:
docs/getting-started.mdx — setup guidesdocs/usage.mdx — event handlers, threads, messages, channelsdocs/streaming.mdx — AI streaming with AI SDKdocs/cards.mdx — JSX interactive cardsdocs/actions.mdx — button/dropdown handlersdocs/modals.mdx — form dialogs (Slack only)docs/adapters.mdx, docs/platform-adapters.mdx — adapter overview and platform-specific setupdocs/state-adapters.mdx — state adapter config (Redis, ioredis, memory)Also read the TypeScript types from node_modules/chat/dist/ to understand the full API surface.
import { Chat } from 'chat';
import { createSlackAdapter } from '@chat-adapter/slack';
import { createRedisState } from '@chat-adapter/state-redis';
const bot = new Chat({
userName: 'mybot',
adapters: {
slack: createSlackAdapter({
botToken: process.env.SLACK_BOT_TOKEN!,
signingSecret: process.env.SLACK_SIGNING_SECRET!,
}),
},
state: createRedisState({ url: process.env.REDIS_URL! }),
});
bot.onNewMention(async (thread) => {
await thread.subscribe();
await thread.post("Hello! I'm listening to this thread.");
});
bot.onSubscribedMessage(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});
post(), subscribe(), startTyping()text, formatted (mdast AST), raw| Handler | Trigger |
|---|---|
onNewMention | Bot @-mentioned in unsubscribed thread |
onSubscribedMessage | Any message in subscribed thread |
onNewMessage(regex) | Messages matching pattern in unsubscribed threads |
onSlashCommand("/cmd") | Slash command invocations |
onReaction(emojis) | Emoji reactions added/removed |
onAction(actionId) | Button clicks and dropdown selections |
onAssistantThreadStarted | Slack Assistants API thread opened |
onAppHomeOpened | Slack App Home tab opened |
Pass any AsyncIterable<string> to thread.post(). Works with AI SDK's textStream:
import { ToolLoopAgent } from 'ai';
const agent = new ToolLoopAgent({ model: 'anthropic/claude-sonnet-5' });
bot.onNewMention(async (thread, message) => {
const result = await agent.stream({ prompt: message.text });
await thread.post(result.textStream);
});
Set jsxImportSource: "chat" in tsconfig. Components: Card, CardText, Button, Actions, Fields, Field, Select, SelectOption, Image, Divider, LinkButton, Section, RadioSelect.
await thread.post(
<Card title="Order #1234">
<CardText>Your order has been received!</CardText>
<Actions>
<Button id="approve" style="primary">
Approve
</Button>
<Button id="reject" style="danger">
Reject
</Button>
</Actions>
</Card>,
);
chat and the @chat-adapter/* packages are an external SDK this repo
consumes (pinned via semver range in package.json), not something built or
versioned here — there's no Changesets/release flow to document for them.
| Package | Purpose |
|---|---|
chat | Core SDK |
@chat-adapter/discord | Discord |
@chat-adapter/slack | Slack |
@chat-adapter/telegram | Telegram |
@chat-adapter/state-ioredis | ioredis state |
@lobechat/chat-adapter-feishu | Lark/Feishu — built in-repo (packages/chat-adapter-feishu), not from @chat-adapter/ |
@lobechat/chat-adapter-imessage | iMessage via BlueBubbles — built in-repo |
@lobechat/chat-adapter-line | LINE Messaging API — built in-repo |
@lobechat/chat-adapter-qq | QQ Bot — built in-repo |
@lobechat/chat-adapter-wechat | WeChat (iLink) — built in-repo |
Each adapter exposes a webhook handler via bot.webhooks.{platform}. Wire these to your HTTP framework's routes (e.g. Next.js API routes, Hono, Express).
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
通过实际操作产品验证交付内容,记录用户可查看的证据,并发布验收报告。可检查已有验证计划或创建检查项,选择合适的操作界面,并使用 `lh` CLI 发布结果。
本技能指导在 LobeHub 中接入 AI 模型提供商,涵盖运行时、模型信息、设置、品牌展示、文档和验收,并帮助判断新增模型是否需要新的提供商集成。
本技能指导如何用服务器端环境变量设置用户偏好默认值,涵盖变量校验、服务器配置、写入用户状态,以及更新 `.env.example` 和自托管文档。
说明如何在智能体执行步骤、工具调用、人工审批、上下文压缩和子智能体调用时注册钩子。钩子可观察事件、模拟本地工具结果,也可通过 Webhook 按配置策略允许或拒绝工具调用。
此技能用于为智能体设计事件驱动的后台工作流,划分来源、信号、动作和策略的职责,并处理异步交接、去重、执行范围、完成记录与运行观测。
本技能在 macOS 桌面聊天应用中测试机器人频道:打开应用、进入频道或联系人、发送消息、等待回复并截图。支持 Discord、Slack、Telegram、微信、飞书和 QQ;iMessage 使用 BlueBubbles 桥接。