当前位置: 首页 > Skill >

Feishu Chat

Feishu Chat

Feishu Chat

飞书(Lark)群聊消息指南,适用于OpenClaw。支持原始/卡片消息模式、@提及格式及群成员管理,用于发送消息。

1.1.1 2026.11.22 284
获取Skill文件查看使用说明
作 者:江川 许可证: 更新时间:2026.11.22
本文目录展开

Feishu Group Chat Guide

Quick Start: Configure renderMode

⚠️ 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

Prerequisites

  1. In a Feishu group - OpenClaw connected to Feishu
  2. Configure renderMode - Set to "card" for consistent formatting
  3. Know member IDs:
    • Human: open_id (ou_xxx format)
    • Bot: App ID (cli_xxx format)

0. Message Format Stability

The Problem: Raw vs Card Mixing

Without proper renderMode configuration, messages can inconsistently appear as:

  • Raw text: Plain markdown source, no formatting
  • Card format: Rendered markdown with syntax highlighting, tables, links

The Solution: Explicit renderMode

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.

1. Message Sending

⚠️ CRITICAL: Only Use ONE Method

DO NOT use both direct reply and message tool for the same content! This will send two messages.

Choose ONE:

  • Plain text → message tool only
  • Markdown → direct reply only

Two Methods

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

Raw Mode (Plain Text)

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:

  • ❌ No Markdown rendering (bold, italic, code blocks won't render)
  • ❌ Tables won't render
  • ❌ Links won't render
  • ✅ @ mentions work correctly

Card Mode (Markdown)

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):

  • Code blocks
  • Tables | table |
  • Bold **bold**
  • Italic *italic*
  • Strikethrough ~~text~~
  • Links [link](url)
  • Headings # heading
  • Lists - 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:

  • Use **bold** for emphasis
  • Use *italic* for light emphasis
  • Use numbered lists 1. or bullet lists -
  • Avoid ---, >, and inline code
  • Keep formatting simple

Avoid Auto Mode

Problem: Auto mode can incorrectly choose between Raw and Card.

Best Practice:

  • Plain text → Use message tool (Raw mode)
  • Markdown content → Direct reply (Card mode)

Don't:

  • Use message tool for Markdown (won't render)
  • Use complex structures in Card mode (may trigger Raw incorrectly)

2. Group Member Management

⚠️ Important: Bots Only See @ Mentioned Messages

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:

  • To identify a human member's open_id, they must @ mention the bot and send a message
  • The bot cannot see past messages where it wasn't mentioned

How to Get Member IDs

Human open_id (must @ mention bot):

  1. Ask the human to @ mention the bot and send any message
  2. When the message arrives, the system shows: [Feishu oc_xxx:ou_xxx timestamp] nickname: message content
  3. The ou_xxx is the sender's open_id

Bot App ID (requires user to provide):

  1. Go to Feishu Developer Console: https://open.feishu.cn/app
  2. Click on the bot you want to view
  3. In "Application Credentials" (应用凭证), copy the App ID (cli_xxx format)
  4. @ mention the bot and send the App ID

Maintain Member List

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)

3. @ Mention Tips

@ Format Difference (Critical!)

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>

@ Different Target Types

@ 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>

@ Bot vs @ Human

Important difference:

  • Bots: MUST be @ mentioned to receive messages! Without @, bots won't get notified
  • Humans: Can see all group messages, @ not required

⚠️ Feishu Limitation: Bot-to-Bot Messages

  • A bot CAN send messages and @ mention another bot
  • But bots can only receive messages from human accounts
  • Bots cannot receive messages from other bots
  • Therefore, @ mentioning another bot will NOT notify that bot

Practical implication:

  • If you need to communicate with another bot, ask a human to send the message instead
  • Bot-to-bot communication is not possible in Feishu groups

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**

@ Everyone

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!

Common @ Mistakes

Raw mode errors:

  • @nickname - Plain text, no notification
  • @{nickname} - Plain text
  • <at id="ou_xxx"></at> - id attribute doesn't work in Raw mode

Card mode errors:

  • <at user_id="ou_xxx">nickname</at> - user_id attribute doesn't work in Card mode

4. Quick Reference

Message Decision Tree

Need to send message
    │
    ├─ Plain text only?
    │   └─ YES → message tool (Raw mode)
    │
    └─ Need Markdown?
        └─ YES → Direct reply (Card mode)

@ Mention Decision Tree

Need to @ mention
    │
    ├─ Using message tool?
    │   └─ YES → <at user_id="ID">nickname</at>
    │
    └─ Direct reply (Card mode)?
        └─ YES → <at id=ID></at>

ID Format Reference

Type Format Example
Human open_id ou_xxx ou_example123abc
Bot App ID cli_xxx cli_example456def
Group chat_id oc_xxx oc_example789ghi

5. Important Notes

  1. Card and Raw mode use different @ formats - Wrong format = @ fails
  2. Bots MUST be @ mentioned to receive messages - Humans don't need @
  3. Bot-to-bot communication is NOT possible - Bots can only receive messages from humans, not other bots
  4. message tool only sends Raw mode - No Markdown rendering
  5. @everyone requires group permission
  6. Avoid unsupported styles in Card mode (blockquote, inline code, horizontal rule)

6. Configuration Reference

renderMode Settings

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

Troubleshooting

Messages appear as raw markdown:

  1. Check: openclaw config get channels.feishu.renderMode
  2. Set: openclaw config set channels.feishu.renderMode "card"
  3. Restart: openclaw gateway restart

Format switches between raw and card:

  • Cause: Using renderMode: "auto"
  • Fix: Change to "card" or "raw" explicitly

Proactive messages not using card:

  • Expected: Proactive messages (via message tool) always use plain text
  • Workaround: Have user send a message first, then reply

Source

  • Tested on: OpenClaw Feishu integration
  • Test date: 2026-02-27 ~ 2026-02-28
  • Source files:
    • /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

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
Skill 文件
  • SKILL.md
    • Feishu Group Chat Guide
    • Quick Start: Configure renderMode
    • Prerequisites
    • 0. Message Format Stability
      • The Problem: Raw vs Card Mixing
      • The Solution: Explicit renderMode
    • 1. Message Sending
      • ⚠️ CRITICAL: Only Use ONE Method
      • Two Methods
      • Raw Mode (Plain Text)
      • Card Mode (Markdown)
      • Avoid Auto Mode
    • 2. Group Member Management
      • ⚠️ Important: Bots Only See @ Mentioned Messages
      • How to Get Member IDs
      • Maintain Member List
    • 3. @ Mention Tips
      • @ Format Difference (Critical!)
      • @ Different Target Types
      • @ Bot vs @ Human
      • @ Everyone
      • Common @ Mistakes
    • 4. Quick Reference
      • Message Decision Tree
      • @ Mention Decision Tree
      • ID Format Reference
    • 5. Important Notes
    • 6. Configuration Reference
      • renderMode Settings
      • Troubleshooting
    • Source
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期