什么是OpenClaw飞书通道?
OpenClaw飞书通道是OpenClaw提供的一种与飞书平台进行集成的方式,使用户能够通过飞书与OpenClaw进行自然语言交互。通过配置飞书通道,用户可以在飞书中向OpenClaw发送消息,OpenClaw会理解用户的意图并执行相应的操作,然后将结果反馈给用户。
如何配置OpenClaw飞书通道?
要配置OpenClaw飞书通道,用户需要按照以下步骤进行:
- 创建飞书应用:首先,用户需要在飞书开发者平台上创建一个新的应用,并获取应用的App ID和App Secret。
- 配置权限:在飞书应用的权限设置中,确保为应用授予必要的权限,以便它能够接收消息并与OpenClaw进行通信。
- 获取Webhook URL:在飞书应用的设置中,获取Webhook URL,这个URL将用于OpenClaw与飞书进行通信。
- 配置OpenClaw:在OpenClaw的设置界面中,输入飞书应用的App ID、App Secret和Webhook URL,并保存配置。
- 测试连接:配置完成后,用户可以通过OpenClaw的测试功能来验证飞书通道的连接是否成功,并确保OpenClaw能够正确接收飞书中的消息并进行处理。
飞书通道配置示例
创建飞书应用
- 创建一个新的应用:
- 填写相关的信息:
添加机器人
选择 添加应用能力 -> 按能力添加 -> 机器人 -> 添加:
给予相关的权限
在权限管理页面,点击 批量导入/导出权限,选择 导入权限,将以下权限列表复制粘贴到文本框中,然后点击 导入权限:
{
"scopes": {
"tenant": [
"aily:file:read",
"aily:file:write",
"application:application.app_message_stats.overview:readonly",
"application:application:self_manage",
"application:bot.menu:write",
"cardkit:card:write",
"contact:user.employee_id:readonly",
"corehr:file:download",
"docs:document.content:read",
"event:ip_list",
"im:chat",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.group_msg",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource",
"sheets:spreadsheet",
"wiki:wiki:readonly"
],
"user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
创建初始版本
之后我们会进行修改的,先发布一个,然后才能配置事件订阅。
随意填写,保存发布即可:
为OpenClaw添加通道
进入飞书机器人的 凭证与基础信息 页面,复制 应用凭证 ,之后我们会用到:
进入OpenClaw的设置界面:
openclaw configure方向键上下选择本地(Local),然后回车:
◆ Where will the Gateway run?
│ ● Local (this machine) (Gateway reachable (ws://127.0.0.1:18789))
│ ○ Remote (info-only)
└2
3
4
方向键向下选择 Channels,回车:
◆ Select sections to configure
│ ○ Workspace
│ ○ Model
│ ○ Web tools
│ ○ Gateway
│ ○ Daemon
│ ● Channels (Link WhatsApp/Telegram/etc and defaults)
│ ○ Skills
│ ○ Health check
│ ○ Continue
└2
3
4
5
6
7
8
9
10
11
方向键向下选择 Configure/link,回车:
进行配置
◆ Channels
│ ● Configure/link (Add/update channels; disable unselected accounts)
│ ○ Remove channel config
└2
3
4
方向键向下选择 Feishu/Lark (飞书),回车:
◆ Select a channel
│ ○ Telegram (Bot API)
│ ○ WhatsApp (QR link)
│ ○ Discord (Bot API)
│ ○ IRC (Server + Nick)
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ● Feishu/Lark (飞书) (plugin · install)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ○ Synology Chat (Webhook)
│ ○ Tlon (Urbit)
│ ○ Finished
└2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
安装模式选择 npm 安装,方向键向下选择 Download from npm,回车::
◆ Install Feishu plugin?
│ ● Download from npm (@openclaw/feishu)
│ ○ Skip for now
└2
3
4
输入飞书应用的 App ID 和 App Secret:
◆ Enter Feishu App ID
│ cli_a90f*****89cd9
└
◆ Enter Feishu App Secret
│ DAViZXBY*****fMyCV*****nC3Y
└2
3
4
5
6
7
8
选择中国站点(Feishu (feishu.cn) - China),回车:
◆ Which Feishu domain?
│ ● Feishu (feishu.cn) - China
│ ○ Lark (larksuite.com) - International
└2
3
4
选择开放式的回答:
◆ Group chat policy
│ ○ Allowlist - only respond in specific groups
│ ● Open - respond in all groups (requires mention)
│ ○ Disabled - don't respond in groups
└2
3
4
5
选择 Finished ,回车:
◆ Select a channel
....
│ ● Finished (Done)
└2
3
4
使用方向键左右,选择 Yes ,回车:
◆ Configure DM access policies now? (default: pairing)
│ ● Yes / ○ No
└2
3
选择 Pairing:
◆ Feishu DM policy
│ ● Pairing (recommended)
│ ○ Allowlist (specific users only)
│ ○ Open (public inbound DMs)
│ ○ Disabled (ignore DMs)
└2
3
4
5
6
最后选择 Continue,回车:
◆ Select sections to configure
│ ○ Workspace
│ ○ Model
│ ○ Web tools
│ ○ Gateway
│ ○ Daemon
│ ○ Channels
│ ○ Skills
│ ○ Health check
│ ● Continue (Done)
└2
3
4
5
6
7
8
9
10
11
配置事件订阅
在 事件订阅 页面:
- 选择 使用长连接接收事件(WebSocket 模式)
- 添加事件:
im.message.receive_v1(接收消息)
⚠️ 注意:如果网关未启动或渠道未添加,长连接设置将保存失败。
发布新版本
在 版本管理与发布 页面:
- 选择 创建版本
- 填写 版本号 和 说明
- 将页面拉到最下方,点击 保存 ,确认发布
我们就会在飞书界面收到一个提醒,点击 打开应用 即可进入聊天界面。
配对
打开聊天界面之后,发送任意一条消息,机器人会回复一个配对码,我们需要用到这个配对码进行配对:
手动运行此命令:
飞书测试
在聊天界面,给机器人发送一条消息,进行测试:
你是谁?用的什么模型?检查下当前运行的设备名字是什么?