feat(feishu): add global group mention policy
- Add group_policy config: 'open' (default) or 'mention' - 'open': Respond to all group messages (backward compatible) - 'mention': Only respond when @mentioned in any group - Auto-detect bot mentions by pattern matching: * If open_id configured: match against mentions * Otherwise: detect bot by empty user_id + ou_ open_id pattern - Support @_all mentions - Private chats unaffected (always respond) - Clean implementation with minimal logging docs: update Feishu README with group policy documentation
This commit is contained in:
15
README.md
15
README.md
@@ -482,7 +482,8 @@ Uses **WebSocket** long connection — no public IP required.
|
||||
"appSecret": "xxx",
|
||||
"encryptKey": "",
|
||||
"verificationToken": "",
|
||||
"allowFrom": ["ou_YOUR_OPEN_ID"]
|
||||
"allowFrom": ["ou_YOUR_OPEN_ID"],
|
||||
"groupPolicy": "open"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -491,6 +492,18 @@ Uses **WebSocket** long connection — no public IP required.
|
||||
> `encryptKey` and `verificationToken` are optional for Long Connection mode.
|
||||
> `allowFrom`: Add your open_id (find it in nanobot logs when you message the bot). Use `["*"]` to allow all users.
|
||||
|
||||
**Group Chat Policy** (optional):
|
||||
|
||||
| Option | Values | Default | Description |
|
||||
|--------|--------|---------|-------------|
|
||||
| `groupPolicy` | `"open"` | `"open"` | Respond to all group messages (backward compatible) |
|
||||
| | `"mention"` | | Only respond when @mentioned |
|
||||
|
||||
> [!NOTE]
|
||||
> - `"open"`: Respond to all messages in all groups
|
||||
> - `"mention"`: Only respond when @mentioned in any group
|
||||
> - Private chats are unaffected (always respond)
|
||||
|
||||
**3. Run**
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user