Skip to content

nil957/clawdbot-feishu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clawdbot Feishu Plugin

中文文档

A Feishu (Lark) channel plugin for Clawdbot, enabling your AI assistant to communicate through Feishu messaging platform.

Features

  • ✅ Direct messages (1:1 chat)
  • ✅ Group chat support
  • ✅ WebSocket-based real-time messaging
  • ✅ Seamless integration with Clawdbot agents
  • Image support - Send and receive images
  • Video support - Send video files with auto-generated thumbnails
  • Audio support - Send audio messages
  • File support - Send any file type

Prerequisites

  • Clawdbot installed and configured
  • A Feishu developer account
  • A Feishu application with bot capabilities

Installation

  1. Clone the repository:
cd ~/.clawdbot/extensions
git clone https://github.com/nil957/clawdbot-feishu.git feishu
cd feishu
  1. Install dependencies:
npm install

Feishu App Configuration

  1. Go to Feishu Open Platform
  2. Create a new application (or use an existing one)
  3. Navigate to Add Capabilities → Enable Bot
  4. Configure Events and Callbacks:
    • Go to Events and CallbacksSubscription method
    • Select Use WebSocket to receive events (使用长连接接收事件)
  5. Go to Events and CallbacksAdd Event, add:
    • im.message.receive_v1 (Receive messages)
  6. Go to Permissions & Scopes, add the following permissions:
    • im:message - Read and send messages
    • im:message:send_as_bot - Send messages as bot
    • im:chat:readonly - Read chat info (for group chats)
    • im:resource - Upload images and files
  7. Create App Version and Publish (or enable development mode for testing)
  8. Go to Credentials & Basic Info, copy:
    • App ID (starts with cli_)
    • App Secret

Clawdbot Configuration

Add the following to your ~/.clawdbot/clawdbot.json:

{
  "plugins": {
    "entries": {
      "feishu": {
        "enabled": true,
        "config": {
          "appId": "cli_xxxxxxxxxx",
          "appSecret": "your-app-secret-here"
        }
      }
    }
  }
}

Note: If your clawdbot.json already has other content, merge the feishu section into the existing plugins.entries object.

Usage

  1. Restart Clawdbot gateway:
clawdbot gateway restart
  1. Verify the plugin is loaded:
cat /tmp/clawdbot/*.log | grep -i "feishu.*registered"

You should see: [feishu] Plugin registered, appId: cli_xxx

  1. Start chatting:
    • Open Feishu and find your bot
    • Send a direct message to start a conversation
    • In group chats, @mention the bot to trigger a response

Troubleshooting

Bot not responding

  1. Check if the plugin is loaded:

    cat /tmp/clawdbot/*.log | grep -i feishu
  2. Verify WebSocket connection: Look for [feishu] WebSocket client started in the logs.

  3. Check for errors:

    cat /tmp/clawdbot/*.log | grep -iE "feishu.*error"
  4. Common issues:

    • App ID or App Secret is incorrect
    • WebSocket subscription not enabled in Feishu console
    • Bot permissions not configured
    • App not published (try enabling development mode first)

Connection issues

  • Verify your network can reach Feishu servers
  • Check if a firewall is blocking WebSocket connections
  • Try restarting the gateway: clawdbot gateway restart

Messages received but no reply

  • Check if Clawdbot agent is configured correctly
  • Verify LLM provider settings in clawdbot.json
  • Look for agent errors in logs: cat /tmp/clawdbot/*.log | grep -i agent

License

MIT

About

Feishu (Lark) channel plugin for Clawdbot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors