Skip to content

Chapter 4: Chat Platform Integration

After completing this chapter, you'll be able to chat with the lobster on your phone.

AutoClaw users: Scan the QR code in Lark to complete integration — you can skip this chapter.

0. Which Chat Platforms Are Supported?

OpenClaw supports almost all mainstream chat applications, with text messaging available across all channels.

ChannelDescriptionInstallation
Feishu / LarkWebSocket persistent connection; preferred for enterprise collaborationBuilt-in
WeChatWorkBuddy bridge; personal accounts / WeComPlugin
QQQQ Open Platform Bot APIPlugin
WhatsAppMost popular globally; Baileys library, requires QR pairingBuilt-in
TelegramBot API (grammY); supports group chats, most open APIBuilt-in
DiscordBot API + Gateway; servers, channels, direct messagesBuilt-in
SlackBolt SDK; workspace appsBuilt-in
Signalsignal-cli; privacy-focusedBuilt-in
Google ChatGoogle Chat API; HTTP webhookBuilt-in
iMessageBlueBubbles (recommended) or legacy imsg CLIBuilt-in
IRCClassic IRC server; channels + direct messagesBuilt-in
WebChatBuilt-in web chat interface in the GatewayBuilt-in
LINELINE Messaging APIPlugin
MatrixMatrix open protocolPlugin
MattermostBot API + WebSocketPlugin
Microsoft TeamsBot Framework; enterprise supportPlugin
NostrDecentralized protocol NIP-04Plugin
TwitchIRC connectionPlugin
ZaloZalo Bot API (Vietnam)Plugin
Can multiple platforms be connected at the same time?

Yes. OpenClaw automatically routes messages by source — use Feishu for work and Telegram as a personal assistant, all sharing the same AI brain.

This chapter uses Feishu as the example — it's the preferred platform for office use in China, with deep integration for documents, calendars, and multi-dimensional tables. Telegram is simpler to configure but requires a proxy in mainland China.

1. Prerequisites

  • Completed the installation in Chapter 2 (openclaw status shows normal)
  • A Feishu account (personal account is fine; no enterprise admin permissions required)

2. Create a Feishu App

Step 1: Log in to the Feishu Open Platform

Visit the Feishu Open Platform and log in with your Feishu account.

Feishu Open Platform homepage

Using the international Lark version?

Visit Lark Open Platform and set domain: "lark" in the subsequent configuration.

Step 2: Create an Enterprise Custom App

Click "Create Enterprise Custom App", fill in the name (e.g., "OpenClaw Assistant") and description, then click "Create".

Step 3: Obtain App Credentials

Go to "Credentials & Basic Info", copy the App ID (format: cli_xxx) and App Secret, and save them securely.

Feishu app credentials page

Step 4: Enable Bot Capability

Go to "Add App Capabilities" → "Bot" and click "Add".

Add app capabilities page

This step must be done first: Otherwise, when importing permissions in the next step, messaging-related permissions cannot be enabled.

Step 5: Configure Permissions

Go to "Permission Management", click "Batch Import", and paste the following JSON:

Feishu permission management page

json
{
  "scopes": {
    "tenant": [
      "application:application:self_manage",
      "application:bot.menu:write",
      "cardkit:card:read",
      "cardkit:card:write",
      "contact:contact.base:readonly",
      "contact:user.employee_id:readonly",
      "docs:document.content:read",
      "docx:document:readonly",
      "event:ip_list",
      "im:chat",
      "im:chat.members:bot_access",
      "im:chat:read",
      "im:chat:update",
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.group_msg",
      "im:message.p2p_msg:readonly",
      "im:message.pins:read",
      "im:message.pins:write_only",
      "im:message.reactions:read",
      "im:message.reactions:write_only",
      "im:message:readonly",
      "im:message:recall",
      "im:message:send_as_bot",
      "im:message:send_multi_users",
      "im:message:send_sys_msg",
      "im:message:update",
      "im:resource",
      "sheets:spreadsheet",
      "wiki:wiki:readonly"
    ],
    "user": [
      "base:app:copy",
      "base:app:create",
      "base:app:read",
      "base:app:update",
      "base:field:create",
      "base:field:delete",
      "base:field:read",
      "base:field:update",
      "base:record:create",
      "base:record:delete",
      "base:record:retrieve",
      "base:record:update",
      "base:table:create",
      "base:table:delete",
      "base:table:read",
      "base:table:update",
      "base:view:read",
      "base:view:write_only",
      "board:whiteboard:node:create",
      "board:whiteboard:node:read",
      "calendar:calendar.event:create",
      "calendar:calendar.event:delete",
      "calendar:calendar.event:read",
      "calendar:calendar.event:reply",
      "calendar:calendar.event:update",
      "calendar:calendar.free_busy:read",
      "calendar:calendar:read",
      "contact:contact.base:readonly",
      "contact:user.base:readonly",
      "contact:user.employee_id:readonly",
      "contact:user:search",
      "docs:document.comment:create",
      "docs:document.comment:read",
      "docs:document.comment:update",
      "docs:document.media:download",
      "docs:document:copy",
      "docx:document:create",
      "docx:document:readonly",
      "docx:document:write_only",
      "drive:drive.metadata:readonly",
      "drive:file:download",
      "drive:file:upload",
      "im:chat.members:read",
      "im:chat:read",
      "im:message",
      "im:message.group_msg:get_as_user",
      "im:message.p2p_msg:get_as_user",
      "im:message:readonly",
      "offline_access",
      "search:docs:read",
      "search:message",
      "space:document:delete",
      "space:document:move",
      "space:document:retrieve",
      "task:comment:read",
      "task:comment:write",
      "task:task:read",
      "task:task:write",
      "task:task:writeonly",
      "task:tasklist:read",
      "task:tasklist:write",
      "wiki:node:copy",
      "wiki:node:create",
      "wiki:node:move",
      "wiki:node:read",
      "wiki:node:retrieve",
      "wiki:space:read",
      "wiki:space:retrieve",
      "wiki:space:write_only"
    ]
  }
}

This permission bundle covers the full set of capabilities including messaging, cloud documents, multi-dimensional tables, calendar, and tasks.

What do these permissions do?
Permission CategoryRepresentative PermissionsPurpose
App Management (application:)application:application:self_manage, application:bot.menu:writeApp self-management, bot menu configuration
Message Cards (cardkit:)cardkit:card:read, cardkit:card:writeRead and write message cards
Messaging (im:)im:message, im:message:send_as_bot, im:resourceSend and receive messages, images, files
Group Chat (im:chat)im:chat, im:chat.members:bot_accessGroup chat management, member access
Contacts (contact:)contact:user.base:readonly, contact:user.employee_id:readonlyRetrieve basic user information
Cloud Documents (docx:/docs:)docx:document:create, docs:document.content:readCreate and read Feishu documents
Spreadsheets (sheets:)sheets:spreadsheetOperate Feishu spreadsheets
Multi-dimensional Tables (base:)base:record:create, base:table:readOperate multi-dimensional table data
Calendar (calendar:)calendar:calendar.event:create, calendar:calendar.event:readManage calendar events
Tasks (task:)task:task:read, task:task:writeCreate and manage Feishu tasks
Wiki (wiki:)wiki:node:read, wiki:wiki:readonlyRead and write the Feishu knowledge base
Cloud Storage (drive:/space:)drive:file:upload, drive:file:downloadUpload and download files
Whiteboard (board:)board:whiteboard:node:create, board:whiteboard:node:readRead and write Feishu whiteboards
Search (search:)search:docs:read, search:messageSearch documents and messages
Events (event:)event:ip_listEvent push IP allowlist

If you only need basic chat functionality, the minimum required permissions are: im:message, im:message.p2p_msg:readonly, im:message.group_at_msg:readonly, im:message:send_as_bot, and im:resource. However, importing the full permission set is recommended for the best experience.

After importing, click "Apply for Authorization" to confirm. Enterprise admins can approve directly; otherwise, contact your admin for review.

Step 6: Publish the App

Go to "Version Management & Publishing", click "Create Version", fill in the version number, and submit the publishing request. The app takes effect once approved by the admin (you can approve it yourself if you are the admin).

Version management and publishing page

3. Add the Feishu Channel in OpenClaw

Return to your terminal and run:

bash
openclaw channels add

Select "Feishu/Lark", enter the App ID and App Secret, and keep the rest as defaults. After adding, restart the gateway:

bash
openclaw gateway restart
openclaw gateway status

Confirm that the feishu channel status in the output shows connected.

Equivalent CLI command (recommended)

Don't want to use the interactive wizard? You can do it in one line:

bash
openclaw channels add --channel feishu --token "cli_xxx:your_app_secret"
openclaw gateway restart

Not recommended to edit the config file directly — manually editing JSON is prone to missing commas or brackets, which causes configuration parsing failures. Always prefer CLI commands.

3.5 Configure Event Subscriptions

This step must be performed after the previous step (adding the channel + starting the gateway). Feishu performs a real-time check for WebSocket connections when saving persistent connection settings — if the OpenClaw gateway is not running, Feishu will report an "Application connection information not detected" error and will not save.

Return to the Feishu Open Platform and go to "Events & Callbacks" → "Event Configuration":

Events and callbacks page

  1. Select "Use persistent connection to receive events"
  2. Add event: im.message.receive_v1
Why use a persistent connection instead of a Webhook?

Webhooks require a public IP address. A persistent connection (WebSocket) has OpenClaw actively connect to Feishu — no public IP, no domain name, and it works on a home network.

4. Pairing and First Conversation

Find your bot in Feishu and send "Hello". The bot will reply with an 8-character pairing code:

Feishu pairing code prompt interface

Why is pairing required?

To prevent strangers from abusing your bot — every conversation consumes your API quota. When a new user sends their first message, they receive a pairing code. They can only have a normal conversation after you approve them. Pairing codes expire after 1 hour.

Approve in the terminal:

bash
openclaw pairing approve feishu <pairing-code>

For example: openclaw pairing approve feishu 6KKG7C7K. You can also click Approve in the web dashboard (openclaw dashboard).

Once paired, the lobster in Feishu will respond to you. Try:

Hello, please introduce yourself

5. Using in Group Chats

Add the bot to a Feishu group and @mention the bot to trigger a reply.

Group chat access control

OpenClaw controls group chat behavior via groupPolicy:

PolicyBehavior
"open"Allow all group chats; still requires @mention to reply
"allowlist"Only allow groups on the allowlist (default)
"disabled"Disable all group chat messages

Configuration examples:

bash
# Allow all group chats
openclaw config set channels.feishu.groupPolicy "open"

# Set a specific group to reply without requiring @mention
openclaw config set channels.feishu.groups.<group-id>.requireMention false

Each group in a group chat has its own independent conversation — group conversations do not affect your private chat history with the bot.

Direct message access policy (dmPolicy)

dmPolicy controls who can use your bot via direct message:

PolicyBehavior
"pairing"Default. New users require pairing code approval
"allowlist"Only allow users in the allowFrom list
"open"Allow everyone (requires setting "*" in allowFrom)
"disabled"Disable direct messages

6. Troubleshooting

Event subscription fails to save?

First confirm the gateway is running (openclaw gateway status). Persistent connection mode requires the gateway to be online for registration.

Bot not replying?

Troubleshoot in order:

  1. openclaw status — Is the gateway running?
  2. openclaw pairing list feishu — Has pairing been completed?
  3. openclaw logs --follow — View real-time logs to locate the error
  4. openclaw gateway restart — Restart and retry

Permission review rejected?

If you are the admin, go to the Feishu Admin Console → "Workplace" → "App Review", find the app, and click "Approve".

App review page

Configuration changes not taking effect?

Run openclaw gateway restart. For more configuration options, see Appendix G.

@mentioned the bot in a group chat but no response?

Check whether groupPolicy is set to "disabled" or "allowlist" (the latter requires adding the group ID to the allowlist).

Licensed under CC BY-NC-SA 4.0