DEV Community

Lier
Lier

Posted on • Edited on

Connect ClawdBot to Lark/Feishu: Build a 24/7 AI Assistant for Your Team

What if your entire team could message an AI that actually controls a computer?

I've been running ClawdBot (now rebranded to MoltBot) on a Linux server for a few weeks. Works great through Telegram. But my team uses Lark (Feishu) for everything. So I spent a weekend figuring out how to connect ClawdBot to Lark's bot API.

Turns out it's not that hard. Here's the complete setup.

Why Lark/Feishu?

If you're not familiar: Lark (called Feishu in China) is ByteDance's enterprise collaboration platform. Think Slack meets Google Workspace. Popular in Asia-Pacific, especially with tech companies.

ClawdBot already supports Telegram, WhatsApp, and Discord. But for teams already on Lark, having a native integration means:

  • No switching apps
  • Better adoption (people actually use it)
  • Team-wide access to the same AI assistant

Prerequisites

Before starting:

  • ClawdBot running on Ubuntu/Linux (the Gateway must be online)
  • Lark/Feishu Enterprise account (personal accounts can't create custom apps)

Step 1: Install the Lark Plugin

SSH into your server and run:

clawdbot plugins install @m1heng-clawd/feishu
Enter fullscreen mode Exit fullscreen mode

You'll see:

Installed plugin: feishu
Restart the gateway to load plugins.
Enter fullscreen mode Exit fullscreen mode

Don't restart yet. We need to configure Lark first.

Step 2: Create a Lark App

Go to Lark Open Platform (or open.feishu.cn for China).

  1. Click "Create Custom App"
  2. Fill in app name and description
  3. In "Add Capabilities", select "Bot"

Configure Events

This is where most people get stuck.

  1. Go to "Events & Callbacks"
  2. Critical: Choose "Long Connection" as the subscription method (not webhook)
  3. Add event: Search for "Receive Message" → enable im.message.receive_v1

Long connection is more reliable than webhooks. No need to expose ports or deal with SSL certs.

Enable Permissions

In "Permissions & Scopes", enable these 9 permissions:

Permission Why You Need It
contact:user.base:readonly Get user info
im:chat Access group chats
im:chat:read Read group info
im:chat:update Update group info
im:message Send/receive messages
im:message.group_at_msg:readonly Receive @mentions in groups
im:message:send_as_bot Send messages as bot
im:message.p2p_msg:readonly Critical - Receive DMs
im:resource Upload/download files

Important: Without im:message.p2p_msg:readonly, your bot won't receive direct messages. I spent an hour debugging this.

Publish the App

  1. Click "Create Version" at the top
  2. Add version number and release notes
  3. Save and publish

Note: You must republish whenever you change permissions. Changes don't take effect until published.

Step 3: Configure ClawdBot

Get your App ID and App Secret from the "Credentials" page in Lark Developer Console.

clawdbot config set channels.feishu.appId "cli_xxxxx"
clawdbot config set channels.feishu.appSecret "your_app_secret"
clawdbot config set channels.feishu.enabled true

# For Lark (international)
clawdbot config set channels.feishu.domain "lark"

# Restart to apply
clawdbot gateway restart
Enter fullscreen mode Exit fullscreen mode

For Feishu (China), use domain: "feishu" instead.

Step 4: Verify Connection

Check the Gateway status:

clawdbot gateway status
Enter fullscreen mode Exit fullscreen mode

Should show:

Runtime: running
RPC probe: ok
Enter fullscreen mode Exit fullscreen mode

Check Lark connection in logs:

tail -50 /tmp/clawdbot/clawdbot-*.log | grep -i feishu
Enter fullscreen mode Exit fullscreen mode

Look for:

feishu: starting feishu provider (mode: websocket)
feishu: bot open_id resolved: ou_xxxxx
feishu: WebSocket client started
Enter fullscreen mode Exit fullscreen mode

If you see "WebSocket client started", you're connected. Open Lark, search for your bot name, and send "Hello". You should get a response.

Troubleshooting: Long Messages Get Split

Problem: ClawdBot's responses get chopped into multiple messages.

Cause: Default chunk limit is 4000 characters.

Fix:

clawdbot config set channels.feishu.textChunkLimit 10000
clawdbot config set channels.feishu.chunkMode "paragraph"
clawdbot gateway restart
Enter fullscreen mode Exit fullscreen mode

This increases the limit and splits on paragraph breaks instead of character count.

Known Limitation: Image Receiving

Here's something I should be upfront about: ClawdBot can't receive images through Lark yet.

If users send images, you'll see errors like:

[tools] image failed: ENOENT: no such file or directory, open 'img_v3_xxx'
Enter fullscreen mode Exit fullscreen mode

The plugin extracts the image key but doesn't actually download the image file. It's a plugin limitation, not ClawdBot's fault.

Workarounds:

  • Ask users to describe images in text
  • Use OCR tools on mobile before sending
  • For image-heavy workflows, use Telegram instead (full image support)

I've filed an issue with the plugin maintainer. Hopefully fixed soon.

Full Configuration Reference

Here's my production config:

channels:
  feishu:
    enabled: true
    appId: "cli_xxxxx"
    appSecret: "secret"
    domain: "lark"           # or "feishu" for China
    connectionMode: "websocket"
    dmPolicy: "pairing"      # pairing | open | allowlist
    groupPolicy: "allowlist" # open | allowlist | disabled
    requireMention: true     # Require @bot in groups
    textChunkLimit: 10000
    chunkMode: "paragraph"
Enter fullscreen mode Exit fullscreen mode

What's Next

Now your team can message ClawdBot through Lark. It handles emails, manages files, runs terminal commands—all from the chat window.

The community at molt-bot.net has more integration guides. Same docs work for both ClawdBot and MoltBot (they're the same tool, different name after the rebrand).


Bottom line: Lark + ClawdBot = team-wide AI assistant without leaving your existing workflow. 30 minutes of setup, permanent productivity boost.

Using ClawdBot with other platforms? Share your setup in the comments.


Full disclosure: This article was created with the help of AI.

Top comments (0)