消息+文档+日历+任务+多维表格 = AI Agent的飞书工作台
飞书是中国最流行的企业协作工具之一。OpenClaw深度集成飞书,让AI Agent可以:
// 发送文本消息到群聊
await message({
action: "send",
target: "feishu:chat:oc_c942dfd09730eb94bf838c6519c115e9",
message: "今日AI新闻日报已生成!"
});
// 发送富文本消息
await feishu_im_user_message({
action: "send",
receive_id_type: "chat_id",
receive_id: "oc_c942dfd09730eb94bf838c6519c115e9",
msg_type: "post",
content: JSON.stringify({
zh_cn: {
title: "📊 每日营销报告",
content: [[
{ tag: "text", text: "今日新增用户: 1,234\n" },
{ tag: "text", text: "网站PV: 56,789\n" },
{ tag: "a", text: "查看完整报告", href: "https://miaoquai.com/report" }
]]
}
})
});
// 获取群聊历史消息
const messages = await feishu_im_user_get_messages({
chat_id: "oc_c942dfd09730eb94bf838c6519c115e9",
page_size: 20
});
// 搜索消息
const results = await feishu_im_user_search_messages({
query: "AI新闻",
chat_id: "oc_c942dfd09730eb94bf838c6519c115e9"
});
// 从Markdown创建飞书文档
const doc = await feishu_create_doc({
title: "2026-06-23 AI新闻日报",
markdown: `# AI新闻日报
## 今日头条
- OpenClaw发布v2026.6.9重大更新
- NVIDIA与OpenClaw合作加强Skill安全
## 热门工具
1. headroom - Token压缩工具
2. deer-flow - 超级代理框架`,
folder_token: "fldcnXXX"
});
// 获取文档内容
const content = await feishu_fetch_doc({
doc_id: "doccnXXX"
});
// 搜索文档
const docs = await feishu_search_doc_wiki({
action: "search",
query: "AI新闻日报"
});
// 追加内容到文档末尾
await feishu_update_doc({
doc_id: "doccnXXX",
mode: "append",
markdown: "\n\n## 补充更新\n- 新增竞品分析数据"
});
// 创建会议日程
const event = await feishu_calendar_event({
action: "create",
summary: "产品评审会议",
description: "讨论Q3产品规划",
start_time: "2026-06-24T15:00:00+08:00",
end_time: "2026-06-24T16:30:00+08:00",
attendees: [
{ type: "user", id: "ou_zhangsan" },
{ type: "user", id: "ou_lisi" }
],
user_open_id: "ou_current_user"
});
// 查询本周日程
const events = await feishu_calendar_event({
action: "list",
start_time: "2026-06-23T00:00:00+08:00",
end_time: "2026-06-29T23:59:59+08:00"
});
// 创建任务并分配负责人
const task = await feishu_task_task({
action: "create",
summary: "完成SEO巡检报告",
description: "检查死链、meta标签、sitemap",
due: {
timestamp: "2026-06-23T18:00:00+08:00",
is_all_day: false
},
members: [
{ id: "ou_miaoquai", type: "app", role: "assignee" }
]
});
// 创建项目任务清单
const tasklist = await feishu_task_tasklist({
action: "create",
name: "Q3 SEO优化计划",
members: [
{ id: "ou_boss", type: "user", role: "editor" }
]
});
// 创建竞品监控表
const table = await feishu_bitable_app({
action: "create",
name: "竞品监控数据"
});
// 添加字段
await feishu_bitable_app_table_field({
action: "create",
app_token: table.app_token,
table_id: "tblXXX",
field_name: "竞品名称",
type: 1 // 文本
});
// 添加记录
await feishu_bitable_app_table_record({
action: "create",
app_token: table.app_token,
table_id: "tblXXX",
fields: {
"竞品名称": "futurepedia.io",
"访问量": 1234567,
"更新时间": Date.now()
}
});