feishu support

This commit is contained in:
tao.jun
2026-02-04 14:07:45 +08:00
parent 9a0f8fcc73
commit 50fa024ab4
5 changed files with 367 additions and 1 deletions

View File

@@ -162,12 +162,13 @@ nanobot agent -m "Hello from my local LLM!"
## 💬 Chat Apps
Talk to your nanobot through Telegram or WhatsApp — anytime, anywhere.
Talk to your nanobot through Telegram, WhatsApp, or Feishu — anytime, anywhere.
| Channel | Setup |
|---------|-------|
| **Telegram** | Easy (just a token) |
| **WhatsApp** | Medium (scan QR) |
| **Feishu** | Medium (app credentials) |
<details>
<summary><b>Telegram</b> (Recommended)</summary>
@@ -238,6 +239,56 @@ nanobot gateway
</details>
<details>
<summary><b>Feishu (飞书)</b></summary>
Uses **WebSocket** long connection — no public IP required.
Requires **lark-oapi** SDK:
```bash
pip install lark-oapi
```
**1. Create a Feishu bot**
- Visit [Feishu Open Platform](https://open.feishu.cn/app)
- Create a new app (Custom App)
- Enable bot capability
- Add event subscription: `im.message.receive_v1`
- Get credentials:
- **App ID** and **App Secret** from "Credentials & Basic Info"
- **Verification Token** and **Encrypt Key** from "Event Subscriptions"
**2. Configure**
```json
{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_xxx",
"appSecret": "xxx",
"verificationToken": "xxx",
"encryptKey": "xxx",
"allowFrom": ["ou_xxx"]
}
}
}
```
> Get your Open ID by sending a message to the bot, or from Feishu admin console.
**3. Run**
```bash
nanobot gateway
```
> [!TIP]
> Feishu uses WebSocket to receive messages — no webhook or public IP needed!
</details>
## ⚙️ Configuration
Config file: `~/.nanobot/config.json`
@@ -282,6 +333,14 @@ Config file: `~/.nanobot/config.json`
},
"whatsapp": {
"enabled": false
},
"feishu": {
"enabled": false,
"appId": "cli_xxx",
"appSecret": "xxx",
"verificationToken": "xxx",
"encryptKey": "xxx",
"allowFrom": ["ou_xxx"]
}
},
"tools": {