配置指南
本文档详细介绍飞书插件的所有配置选项。
基础配置
必填项
json
{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_xxxxx",
"appSecret": "xxxxx"
}
}
}可选配置
json
{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_xxxxx",
"appSecret": "xxxxx",
"domain": "feishu",
"requireMention": true,
"connectionMode": "websocket"
}
}
}配置项详解
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| enabled | boolean | false | 是否启用飞书频道 |
| appId | string | - | 飞书应用 ID |
| appSecret | string | - | 飞书应用密钥 |
| domain | string | "feishu" | 域名,feishu 或 lark |
| requireMention | boolean | true | 是否需要 @ 机器人才回复 |
| connectionMode | string | "websocket" | 连接方式:websocket 或 webhook |
| historyLimit | number | 50 | 私聊消息历史条数 |
群组配置
可以为每个群聊单独配置不同的行为:
json
{
"channels": {
"feishu": {
"requireMention": true,
"groupPolicy": "open",
"groups": {
"oc_xxxxx": {
"requireMention": false,
"groupPolicy": "open",
"systemPrompt": "你是一个专业的客服助手"
}
}
}
}
}群组策略 (groupPolicy)
| 值 | 说明 |
|---|---|
| open | 开放,所有群成员都可以交互 |
| allowlist | 仅白名单用户可以交互 |
| disabled | 禁用该群 |
requireMention 配置
true(默认):需要 @ 机器人才会回复false:群内任何消息都会触发回复"open":智能判断,必要时才要求 @
工具开关
可以禁用不需要的工具组以减少 context 开销:
json
{
"channels": {
"feishu": {
"tools": {
"doc": true,
"wiki": true,
"bitable": true,
"calendar": true,
"task": true,
"drive": false
}
}
}
}消息配置
回复模式
json
{
"channels": {
"feishu": {
"replyMode": "auto"
}
}
}| 值 | 说明 |
|---|---|
| auto | 自动选择最佳模式 |
| static | 静态消息(一次性发送) |
| streaming | 流式消息(实时打字效果) |
卡片配置
json
{
"channels": {
"feishu": {
"footer": {
"status": true,
"elapsed": true
}
}
}
}心跳配置
json
{
"channels": {
"feishu": {
"heartbeat": {
"every": "30m",
"activeHours": {
"start": "08:00",
"end": "22:00",
"timezone": "Asia/Shanghai"
}
}
}
}
}完整配置示例
json
{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_xxxxx",
"appSecret": "xxxxx",
"domain": "feishu",
"requireMention": true,
"groupPolicy": "open",
"connectionMode": "websocket",
"historyLimit": 50,
"replyMode": "auto",
"footer": {
"status": true,
"elapsed": true
},
"tools": {
"doc": true,
"wiki": true,
"bitable": true,
"calendar": true,
"task": true,
"drive": true
},
"heartbeat": {
"every": "30m"
},
"groups": {
"oc_team_chat": {
"requireMention": false,
"groupPolicy": "open",
"systemPrompt": "你是一个团队协作助手"
}
}
}
}
}