Lark (Feishu) Integration
Table of contents
Lark/Feishu integration for enterprise communication.
Features
- Bidirectional Communication: Send and receive messages via Lark bot
- Session Binding: Bind Lark chats to chat.nvim sessions
- Automatic Polling: Polls for new messages every 3 seconds
- Long Message Support: Handles messages up to 30,720 characters
- Rich Message Support: Supports text, cards, and other message types
Setup Guide
1. Create Lark App
- Go to https://open.feishu.cn/app
- Create a new custom app
- Copy App ID and App Secret
Keep your app credentials secure! Never share them or commit to version control.
2. Configure Bot Permissions
Required permissions:
im:message.group_msg- Get all messages in groups (sensitive permission)im:message- Get and send messages in private chats and groups
Sensitive permissions may require approval from your organization.
Configuration steps:
- Go to your app → “Permissions & Scopes”
- Search for and enable the required permissions above
- For sensitive permissions, you may need to apply for approval
3. Get Chat ID
- Use Lark API or app to get your chat_id
- For group chats, use the group ID
Chat IDs can be obtained from the Lark developer tools or API responses.
4. Configure chat.nvim
require('chat').setup({
integrations = {
lark = {
app_id = 'YOUR_APP_ID',
app_secret = 'YOUR_APP_SECRET',
chat_id = 'YOUR_CHAT_ID',
},
},
})
Commands
| Command | Description |
|---|---|
:Chat bridge lark |
Bind current session to Lark chat |
Technical Details
- API: Lark Open API
- Authentication: Tenant Access Token (auto-refresh)
- Polling: 3-second intervals
- Message Limit: 30,720 characters
- State Persistence:
stdpath('data')/chat-lark-state.json
Troubleshooting
App Not Approved
Symptom: App lacks required permissions.
Solution:
- Check if app needs approval for production use
- Apply for required permissions in the app dashboard
- Wait for organization approval
Authentication Errors
Symptom: Cannot authenticate with Lark API.
Solution:
- Verify app_id and app_secret are correct
- Check if the app is properly configured
- Verify tenant access token is being refreshed
Message Delivery Issues
Symptom: Messages not being delivered.
Solution:
- Verify chat_id is correct
- Check if the bot has proper permissions
- Ensure the bot is added to the chat/group
Next Steps
- Discord Integration - Setup Discord bot
- Telegram Integration - Setup Telegram bot
- IM Integration Overview - All IM integrations