飞书 Channel 配置指南
逐步指导:创建飞书应用,并将其配置为 OpenClaw 的消息渠道(Channel)。
打开飞书开发者控制台
访问 https://open.feishu.cn/app 并使用您的飞书账号登录。
创建应用
点击 'Create Enterprise App',填写应用名称、描述并选择图标。

获取应用凭证
在 'Credentials & Basic Info' 页面,复制 App ID(格式如 `cli_xxx`)和 App Secret。请妥善保管 App Secret,不要泄露。

启用机器人能力
在 'App Capabilities' > 'Bot' 中启用机器人能力,使应用可以在聊天中作为机器人工作。

配置权限
在 'Permission Management' 中点击 'Bulk Import',粘贴下方 JSON 以导入所需租户与用户权限范围。 ```json { "scopes": { "tenant": [ "contact:contact.base:readonly", "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": [ "contact:contact.base:readonly", "aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read" ] } } ```

在 OpenClaw 中添加飞书渠道
登录您的 OpenClaw 账户,进入 'My OpenClaw' → 'Channels' 并点击 '+ Add Channel'。输入获取到的 Feishu App ID 和 App Secret,保存并等待配置成功。

配置事件订阅与回调
选择 'Use long connection to receive events'(WebSocket 模式)。注意:必须先在 OpenClaw 配置好 Feishu 渠道,否则保存可能失败。

添加事件 `im.message.receive_v1` 以接收传入消息。

发布应用
填写版本信息并保存,然后发布应用,使其在您的租户中可用。

与机器人聊天
在 Feishu Workbench 中找到您创建的机器人并发送消息,开始与其聊天。

