邮件安全检索
Apple Mail
该技能用于在飞书(Lark)中创建并发送交互式卡片消息,替代纯文本回复。卡片支持按钮、表单、投票等富UI元素,用户可直接点击操作而无需手动输入。
安装准备
需先启动回调服务器以接收用户点击事件:
cd scripts
node card-callback-server.js
该服务器采用飞书长轮询模式,无需公网IP即可运行,具备自动重连功能。
发送卡片
命令行方式发送各类卡片:
# 确认对话框
node scripts/send-card.js confirmation "确认删除文件?" --chat-id oc_xxx
# 待办清单
node scripts/send-card.js todo --chat-id oc_xxx
# 投票
node scripts/send-card.js poll "团建活动" --options "保龄球,电影,聚餐" --chat-id oc_xxx
# 自定义模板
node scripts/send-card.js custom --template examples/custom-card.json --chat-id oc_xxx
在Agent中调用
当Agent需要向飞书发送消息时,优先使用交互卡片代替纯文本:
await exec({
command: `node E:\\openclaw\\workspace\\skills\\feishu-interactive-cards\\scripts\\send-card.js confirmation "确认删除文件 test.txt?" --chat-id ${chatId}`
});
处理回调
回调服务器自动将用户点击事件转发至OpenClaw Gateway。Agent接收后解析callback.data.action.value中的数据,执行对应业务逻辑,并可调用updateCard更新卡片状态反馈结果。
| 项目 | 内容 |
|---|---|
| 输入 | chat_id(目标会话ID)、card_type(卡片类型)、title/content(文本内容)、options(选项列表)、template_path(自定义模板路径)、button_value(按钮业务数据) |
| 输出 | message_id(卡片消息标识)、callback_data(用户点击回调数据)、updated_card(卡片更新状态) |
| 适用人群 | 需要在飞书平台实现交互式对话的开发者、构建飞书智能体的技术人员 |
| 不包含 | 飞书机器人基础配置、公网服务器部署方案、其他IM平台的卡片支持 |
原始链接:https://github.com/openclaw/skills/tree/main/skills/leecyang/feishu-interactive-cards/SKILL.md
来源类型:GitHub仓库