飞书 + OpenClaw 无缝集成 - 5 分钟搭建企业 AI 助手。支持群聊机器人、智能客服、自动化工作流。
5 分钟搭建企业 AI 助手 - 零代码,即插即用。
bash
- 访问 https://open.feishu.cn
- 创建「企业自建应用」
- 启用「机器人」权限
- 配置事件回调(OpenClaw 自动处理)
# 在飞书群@机器人
@Jarvis 帮我写一份周报
bash
const client = new lark.Client({
appId: process.env.FEISHUAPPID,
appSecret: process.env.FEISHUAPPSECRET,
});
const OPENCLAWURL = process.env.OPENCLAWURL || http://localhost:3000;
// 处理飞书消息
client.im.message.subscribe({
on: async (event) => {
const { message } = event;
const content = JSON.parse(message.content);
// 发送到 OpenClaw
const response = await axios.post(${OPENCLAW_URL}/api/chat, {
message: content.text,
userId: message.sender_id,
channel: feishu,
});
// 回复消息
await client.im.message.create({
receiveidtype: chat_id,
params: { receiveid: message.chatid },
data: {
msg_type: text,
content: JSON.stringify({ text: response.data.reply })
}
});
}
});
EOF
yaml
product_group:
system: 你是产品群的 AI 助手,关注用户体验、需求分析。
temperature: 0.7
python
def handle_keyword(text):
for keyword, reply in AUTO_REPLY.items():
if keyword in text:
return reply
return None # 转到 OpenClaw 处理
javascript
// 每天早上 9 点发送日报提醒
const schedule = require(node-schedule);
schedule.scheduleJob(0 9 *, async () => {
await client.im.message.create({
receiveidtype: chat_id,
params: { receiveid: WORKGROUP_ID },
data: {
msg_type: interactive,
content: JSON.stringify({
config: {
widescreenmode: true
},
elements: [{
tag: div,
text: {
tag: lark_md,
content: 📊 日报提醒\n\n请大家在今天 18:00 前提交日报
}
}]
})
}
});
});
javascript
// 分析群聊数据,生成报告
async function generateReport(chatId) {
const messages = await client.im.message.list({
params: {
containeridtype: chat_id,
container_id: chatId,
page_size: 100
}
});
// 发送给 OpenClaw 分析
const analysis = await axios.post(${OPENCLAW_URL}/api/analyze, {
data: messages,
task: 总结今天的讨论要点
});
return analysis.data;
}
javascript
// 发送精美卡片
await client.im.message.create({
receiveidtype: chat_id,
params: { receive_id: chatId },
data: {
msg_type: interactive,
content: JSON.stringify({
config: { widescreenmode: true },
header: {
title: {
tag: plain_text,
content: 🚀 AI 分析报告
}
},
elements: [{
tag: div,
text: {
tag: lark_md,
content: 关键结论\n- 用户增长 20%\n- 留存率 85%
}
}]
})
}
});
javascript
// 处理上传的文件
if (message.msg_type === file) {
const fileKey = JSON.parse(message.content).file_key;
// 下载文件
const file = await client.im.file.download({
params: { type: file, file_key: fileKey }
});
// 发送给 OpenClaw 分析
const result = await axios.post(${OPENCLAW_URL}/api/analyze-file, {
file: file.data,
task: 总结这份文档的关键信息
});
}
javascript
// 不同群用不同 Agent
const AGENTS = {
TECHGROUPID: jarvis, // 技术群
PRODUCTGROUPID: assistant, // 产品群
SALESGROUPID: sales-bot, // 销售群
};
async function routeMessage(chatId, text) {
const agent = AGENTS[chatId] || default;
return await axios.post(${OPENCLAW_URL}/api/chat, {
message: text,
agent: agent
});
}
yaml
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 feishu-openclaw-integration-1775968938 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 feishu-openclaw-integration-1775968938 技能
skillhub install feishu-openclaw-integration-1775968938
文件大小: 4.65 KB | 发布时间: 2026-4-13 10:16