Feishu (Lark)
Connect your GolemBot assistant to Feishu (Lark) using WebSocket long-connection mode. No public IP required.
Prerequisites
bash
pnpm add @larksuiteoapi/node-sdkFeishu Open Platform Setup
- Go to Feishu Open Platform and create a new app
- Under Credentials, copy the App ID and App Secret
- Under Event Subscriptions:
- Enable the WebSocket connection mode
- Subscribe to
im.message.receive_v1
- Under Permissions, add:
im:message— send messagesim:message:readonly— receive messagesim:message.group_at_msg:readonly— receive group messages where the bot is @mentioned
- Publish the app version and have an admin approve it
Configuration
yaml
# golem.yaml
channels:
feishu:
appId: ${FEISHU_APP_ID}
appSecret: ${FEISHU_APP_SECRET}sh
# .env
FEISHU_APP_ID=cli_xxxxxxxxxx
FEISHU_APP_SECRET=xxxxxxxxxxxxxxxxxxHow It Works
- Transport: WebSocket long-connection via
WSClientfrom@larksuiteoapi/node-sdk - Events: Listens for
im.message.receive_v1events (text messages only) - Reply: Sends messages via
client.im.v1.message.create()using thechat_id - Chat types: Supports both DMs and group chats
- Group @mention filter: In group chats the bot only responds when directly @mentioned. The @mention key is automatically stripped from the message text before it is passed to the engine
Start
bash
golembot gateway --verboseThe adapter connects to Feishu via WebSocket on startup. Messages appear in logs with [feishu] prefix when --verbose is enabled.
Notes
- WebSocket mode means the bot works behind NAT/firewalls without port forwarding
- Only text messages are processed; images, files, and other types are ignored
- The adapter automatically handles connection lifecycle
- In group chats, the bot only responds to messages that directly @mention it — it ignores all other group traffic