增加Agent多个飞书机器人

一个Agent尽量只用一个飞书机器人配置


一:先增加新的agent

# 创建新的Agent,命名为new-agnet
openclaw agents add new-agnet

# 查看创建结果
openclaw agents list

二:新的agent与新的飞书链接

配置agnet下的channels:

在命令行输入

# 配置new-agnet机器人(替换为实际App ID和App Secret)
openclaw config set agents.new-agnet.channels.feishu.appId "你的new-agnet 飞书 App ID"
openclaw config set agents.new-agnet.channels.feishu.appSecret "你的new-agnet 飞书 App Secret"



# 重启服务生效
openclaw gateway restart

形成的openclawJSON文件如下:若不对的话,手动配置,主要是accounts下的内容,查看仔细。

  "channels": {    
    "feishu": {
      "enabled": true,
      "domain": "feishu",
      "groupPolicy": "allowlist",
      "accounts": {
        "main": {
          "appId": "cli_1",
          "appSecret": "appSecret1",
          "botName": "主助手",
          "groupAllowFrom": [
            "ou_id1"
          ]
        },
        "new-agent": {
          "appId": "cli_2",
          "appSecret": "appSecret2",
          "botName": "工作助手",
          "groupAllowFrom": [
            "ou_id2"
          ]
        },   
      },
      "dmPolicy": "pairing"
    }    
  },
 
绑定agnet与channels的关系
# 绑定 agent 到指定飞书账号
openclaw agents bind --agent <agentId> --bind feishu:<accountId>

# 示例
openclaw agents bind --agent main --bind feishu:main
openclaw agents bind --agent new-agnet --bind feishu:new-agent

JSON文件应显示如下

 "bindings": [
    {
      "agentId": "main",
      "match": {
        "channel": "feishu",
        "accountId": "main"
      }
    },
    {
      "agentId": "work",
      "match": {
        "channel": "feishu",
        "accountId": "new-agent"  #要与前面配置对应
      }
    }
  ],

三:重启gateway

openclaw gateway restart
常见问题:
一:发送消息无法回复:注意添加长连接

二:飞书配置:APP ID 和密钥

三:401:token配置

四:使用新的飞书应用,不要一个飞书应用绑定多个Agent

Logo

小龙虾开发者社区是 CSDN 旗下专注 OpenClaw 生态的官方阵地,聚焦技能开发、插件实践与部署教程,为开发者提供可直接落地的方案、工具与交流平台,助力高效构建与落地 AI 应用

更多推荐