Install
openclaw skills install feishu-chatFeishu (Lark) group chat messaging guide for OpenClaw. Includes Raw/Card message modes, @ mention formatting, and group member management. Use when sending messages in Feishu groups, mentioning users/bots, or formatting messages with Markdown.
openclaw skills install feishu-chat⚠️ IMPORTANT: Set renderMode explicitly for stable message formatting
# Recommended configuration
channels:
feishu:
renderMode: "card" # Always use card format
Why? The default "auto" mode causes unpredictable format switching (raw vs card), creating poor user experience.
Configuration:
openclaw config set channels.feishu.renderMode "card"
openclaw gateway restart
Verify:
openclaw config get channels.feishu.renderMode
open_id (ou_xxx format)App ID (cli_xxx format)Without proper renderMode configuration, messages can inconsistently appear as:
| Mode | Behavior | Use Case |
|---|---|---|
auto | Detects content, uses card for code/tables | ❌ Avoid - unpredictable |
raw | Always plain text | Simple text-only responses |
card | Always interactive card | ✅ Recommended - consistent |
Recommended: renderMode: "card" for all production use.
DO NOT use both direct reply and message tool for the same content! This will send two messages.
Choose ONE:
| Method | Tool | Render Mode | Use Case |
|---|---|---|---|
| message tool | message | Raw (plain text) | Plain text, @ mentions |
| Direct reply | Session reply | Card (with Markdown) | Markdown formatted messages |
When to use: Plain text messages, @ mentions
How to send:
message({
action: "send",
channel: "feishu",
target: "oc_xxx",
message: "Plain text content"
})
@ Mention format:
message({
action: "send",
channel: "feishu",
target: "oc_xxx",
message: "<at user_id=\"ou_xxx\">nickname</at> Hello!"
})
Raw Mode Limitations:
When to use: Formatted messages with code blocks, tables, bold/italic text
How to send: Direct reply in session with Markdown elements.
Card Mode Triggers (any of these):
| table |**bold***italic*~~text~~[link](url)# heading- item or 1. item@ Mention format:
<at id=ou_xxx></at> This is Card mode @ mention
**Markdown content** renders correctly
Supported in Card Mode:
| Style | Syntax | Status |
|---|---|---|
| Bold | **bold** | ✅ Supported |
| Italic | *italic* | ✅ Supported |
| Strikethrough | ~~text~~ | ✅ Supported |
| Color | <font color='red'>text</font> | ✅ Supported |
| Links | [link](https://xxx) | ✅ Supported |
| Headings | # heading | ✅ Supported |
| Lists | - item or 1. item | ✅ Supported |
| Code blocks | code | ✅ Supported |
| Tables | ` | table |
Not Supported in Card Mode:
| Style | Syntax | Status |
|---|---|---|
| Blockquote | > quote | ❌ Not supported |
| Inline code | `code` | ❌ Unstable |
| Horizontal rule | --- | ❌ Not supported |
| Complex nesting | Multiple levels | ❌ Unstable |
Best Practice for Card Mode:
**bold** for emphasis*italic* for light emphasis1. or bullet lists ----, >, and inline codeProblem: Auto mode can incorrectly choose between Raw and Card.
Best Practice:
Don't:
Bots can only see messages that @ mention them! If a group member sends a message without @ mentioning the bot, the bot won't receive it.
This means:
Human open_id (must @ mention bot):
[Feishu oc_xxx:ou_xxx timestamp] nickname: message contentou_xxx is the sender's open_idBot App ID (requires user to provide):
Store member info in memory file:
## Group Members (oc_xxx)
### Humans
- nickname1: `ou_xxx`
- nickname2: `ou_xxx`
### AI Bots
- bot1: `cli_xxx` (must @ to receive messages)
| Mode | @ Format | Example |
|---|---|---|
| Raw (message tool) | <at user_id="ID">nickname</at> | <at user_id="ou_xxx">kk</at> |
| Card (direct reply) | <at id=ID></at> | <at id=ou_xxx></at> |
| @ Target | ID Type | Raw Format | Card Format |
|---|---|---|---|
| Human | open_id (ou_xxx) | <at user_id="ou_xxx">nickname</at> | <at id=ou_xxx></at> |
| Bot | App ID (cli_xxx) | <at user_id="cli_xxx">botname</at> | <at id=cli_xxx></at> |
| Everyone | "all" | <at user_id="all">everyone</at> | <at id=all></at> |
Important difference:
⚠️ Feishu Limitation: Bot-to-Bot Messages
Practical implication:
Example - @ Bot:
// Raw mode
message({
action: "send",
channel: "feishu",
target: "oc_xxx",
message: "<at user_id=\"cli_xxx\">botname</at> Please reply!"
})
// Card mode
<at id=cli_xxx></at> Please reply!
**Markdown content**
Note: Requires group permission (Group Settings > Group Management > Who can @everyone)
// Raw mode
message({
action: "send",
channel: "feishu",
target: "oc_xxx",
message: "<at user_id=\"all\">everyone</at> Important announcement!"
})
// Card mode
<at id=all></at> Important announcement!
Raw mode errors:
@nickname - Plain text, no notification@{nickname} - Plain text<at id="ou_xxx"></at> - id attribute doesn't work in Raw modeCard mode errors:
<at user_id="ou_xxx">nickname</at> - user_id attribute doesn't work in Card modeNeed to send message
│
├─ Plain text only?
│ └─ YES → message tool (Raw mode)
│
└─ Need Markdown?
└─ YES → Direct reply (Card mode)
Need to @ mention
│
├─ Using message tool?
│ └─ YES → <at user_id="ID">nickname</at>
│
└─ Direct reply (Card mode)?
└─ YES → <at id=ID></at>
| Type | Format | Example |
|---|---|---|
| Human open_id | ou_xxx | ou_example123abc |
| Bot App ID | cli_xxx | cli_example456def |
| Group chat_id | oc_xxx | oc_example789ghi |
Location: OpenClaw config file or environment
Quick Setup:
# Set to card mode (recommended)
openclaw config set channels.feishu.renderMode "card"
openclaw gateway restart
Environment-specific configurations:
Development:
channels:
feishu:
renderMode: "raw" # Easier debugging
dmPolicy: "open" # Easier testing
Production:
channels:
feishu:
renderMode: "card" # Consistent formatting
dmPolicy: "pairing" # Security
requireMention: true # Avoid spam
Messages appear as raw markdown:
openclaw config get channels.feishu.renderModeopenclaw config set channels.feishu.renderMode "card"openclaw gateway restartFormat switches between raw and card:
renderMode: "auto""card" or "raw" explicitlyProactive messages not using card:
message tool) always use plain text/home/admin/.openclaw/extensions/feishu/src/bot.ts/home/admin/.openclaw/extensions/feishu/src/reply-dispatcher.ts/home/admin/.openclaw/extensions/feishu/src/mention.ts/home/admin/.openclaw/extensions/feishu/src/send.ts