Feishu Platform Setup
This tutorial walks through creating a Feishu app that Alice can connect to. Estimated time: 15 minutes.
Overview
Alice needs a Feishu app with:
- Bot capability enabled
im.message.receive_v1event subscription- Required message permissions
- Long connection mode enabled
Step 1: Log into Feishu Open Platform
Visit Feishu Open Platform and sign in with your organization account.
Lark (international) users: Visit Lark Open Platform instead. Then set
feishu_base_url: "https://open.larksuite.com"in your bot config.
Step 2: Create an App
- Click Create App (创建应用)
- Choose Enterprise Self-built App (企业自建应用)
- Name your app (e.g., "Alice Bot") and upload an icon
- Click Create
Step 3: Enable Bot Capability
- In the left sidebar, go to Features → Bot (机器人)
- Toggle Enable Bot (启用机器人)
- Configure the bot's name, avatar, and description as desired
Step 4: Add Event Subscription
- Go to Event Subscriptions (事件订阅)
- Click Add Event (添加事件)
- Find and select Receive Message (接收消息) →
im.message.receive_v1 - Click Confirm
This is what allows Alice to receive all messages the bot can see.
Step 5: Configure Permissions
- Go to Permissions (权限管理)
- Search for and enable these permissions:
| Permission | Why |
|---|---|
im:message | Read messages sent to the bot |
im:message:send_as_bot | Send messages as the bot |
im:message:read | Read message content |
im:resource | Download images and files |
contact:user.id:readonly | Resolve user names |
contact:group.id:readonly | Access group chat info |
- Click Save (保存)
Step 6: Enable Long Connection
- Go to Features → Event Subscriptions (事件订阅)
- Find the Connection Mode (连接方式) section
- Switch from Request URL to Long Connection (长连接)
- Save the change
This is critical. Alice uses WebSocket long connections, not HTTP webhooks. If long connection mode is not enabled, Alice cannot receive messages.
Step 7: Get Credentials
- Go to App Settings → Basic Info (基础信息)
- Copy your App ID (应用凭证 → App ID)
- Copy your App Secret (应用凭证 → App Secret)
These go into your config.yaml:
bots:
my_bot:
feishu_app_id: "cli_xxxxxxxx" # your App ID
feishu_app_secret: "your_secret" # your App Secret
Step 8: Publish and Approve
- Go to Version Management (版本管理与发布)
- Click Create Version (创建版本), fill in version info
- After creation, click Apply for Release (申请发布)
- An admin in your Feishu org must approve the release
- Once approved, users in your org can find and interact with the bot
Tip: During development, you can add individual users as App Collaborators (应用协作者) under App Settings, allowing them to test the bot before publishing.
Verification
After starting Alice with alice --feishu-websocket, check the logs:
feishu-codex connector started (long connection mode)
If you see WebSocket connection errors, double-check that long connection mode is enabled and your credentials are correct.