360 Secure SkillHub
360 安全技能中心

feishu-card-sender-beautify 飞书推送展示卡片脚本

该 Skill 说明如何用 feishu_im_user_message 工具向飞书群聊或私聊发送 interactive 类型消息,给出卡片 JSON 结构(config、header、elements)、可用颜色模板对照表,以及群聊 oc_ 与用户 ou_ 的 ID 格式和 receive_id_type 用法,并附卡片模板与 API 参数参考文档。

kolikoliko
kolikoliko
热度 78.20
最近更新 2026-05-11 17:30:11
分类:协作依赖:MCP 服务应用场景:模板 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add feishu-card-sender-beautify
Metadata
name
feishu-card-sender-beautify
description
发送飞书 Interactive Card 格式消息,用于美化富文本卡片推送和优化通知。 触发条件:(1) 用户要求发送卡片消息 (2) 定时任务推送 (3) 格式化通知需求

feishu-card-sender-beautify

发送飞书 Interactive Card 富文本消息。

快速开始

发送卡片到当前聊天

使用 feishu_im_user_message 工具:

feishu_im_user_message(
    action="send",
    msg_type="interactive",
    receive_id="oc_群聊ID",  # 群聊用 oc_xxx
    receive_id_type="chat_id",
    content=json.dumps(card)
)

卡片结构

card = {
    "config": {"wide_screen_mode": True},
    "header": {
        "title": {"tag": "plain_text", "content": "📰 标题"},
        "template": "blue"  # blue/red/green/yellow/wathet/orange/grey
    },
    "elements": [
        {"tag": "div", "text": {"tag": "lark_md", "content": "正文内容"}}
    ]
}

颜色模板

值 颜色
blue 蓝
red 红
green 绿
yellow 黄
wathet 浅蓝
orange 橙
grey 灰

详细文档

注意

  • 群聊 ID 格式:oc_xxx
  • 用户 ID 格式:ou_xxx
  • 发送群聊用 receive_id_type="chat_id"
  • 发送私聊用 receive_id_type="open_id"