Rechercher

PythonReactSEOPDF
OpenClaw

feishu-card-sender

通过飞书 OpenAPI 发送卡片消息(interactive card),支持模板化 JSON 卡片与变量替换。用于用户要求“发送飞书卡片/模板消息/互动卡片”时,或需要把结构化通知发到指定 open_id/chat_id 时。该技能只走 OpenAPI(appid/appsecret + tenant_access_token),不使用 message 通道。

dobbey0 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install dobbey/feishu-card-sender

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

Feishu Card Sender

概览

用统一方式通过飞书 OpenAPI 发送卡片消息,避免每次手写 curl。 本技能固定使用 scripts/send_feishu_card.py(appid/appsecret 鉴权),不走 message 通道。

快速决策

  1. 发送到当前会话用户 → 使用当前会话 sender_id 作为 --receive-id(open_id)
  2. 发送到指定用户/群 → 显式传 --receive-id + --receive-id-type
  3. 需要复用模板 → 把模板放到 assets/templates/*.json,再用 --template + 变量替换

发送方式:脚本发送(OpenAPI,唯一方式)

脚本:scripts/send_feishu_card.py

凭证

按以下优先级自动获取(从高到低):

  1. 命令参数:--app-id / --app-secret
  2. 环境变量:FEISHU_APP_ID / FEISHU_APP_SECRET
  3. OpenClaw 配置:/root/.openclaw/openclaw.json 的 channels.feishu.accounts
    • 可用 --account-id 指定账户(不传则取第一个)
    • 可用 --account-id current 自动读取会话上下文 account_id(从运行时环境变量 best-effort 获取)
常用命令
# 1) 列出内置模板
python3 scripts/send_feishu_card.py --list-templates

# 2) 用 movie 模板发送到 open_id(变量文件)
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"
python3 scripts/send_feishu_card.py \
  --template movie \
  --receive-id ou_xxx \
  --receive-id-type open_id \
  --vars-file references/vars.example.env

# 3) 直接指定模板文件 + 行内变量
python3 scripts/send_feishu_card.py \
  --template-file assets/templates/movie.json \
  --receive-id ou_xxx \
  --var title='星际穿越' \
  --var rating='8.7'

# 4) 只有海报 URL 时,自动上传飞书并注入 poster_img_key
python3 scripts/send_feishu_card.py \
  --template movie-custom \
  --receive-id ou_xxx \
  --receive-id-type open_id \
  --poster-url 'https://image.tmdb.org/t/p/original/xxx.jpg' \
  --var title='星际穿越' \
  --var overview='...'

变量替换规则

  • 模板中占位符写法:${key}
  • 变量来源(后者覆盖前者):
    1. --vars-file(KEY=VALUE)
    2. 多次 --var key=value
  • 未提供的变量保持原样,不报错(便于渐进调试)

参数规范(必读)

发送前先读:

  • references/template-params.md(movie-cus...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/dobbey/feishu-card-sender
Version
—
Commit
ad02724cf6a315810e3a5f41ae8f559624eddb30
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

Contenu extrait

SKILL.md
# Feishu Card Sender

## 概览

用统一方式通过飞书 OpenAPI 发送卡片消息,避免每次手写 curl。
本技能固定使用 `scripts/send_feishu_card.py`(appid/appsecret 鉴权),不走 `message` 通道。

## 快速决策

1. **发送到当前会话用户** → 使用当前会话 `sender_id` 作为 `--receive-id`(open_id)
2. **发送到指定用户/群** → 显式传 `--receive-id` + `--receive-id-type`
3. **需要复用模板** → 把模板放到 `assets/templates/*.json`,再用 `--template` + 变量替换

## 发送方式:脚本发送(OpenAPI,唯一方式)

脚本:`scripts/send_feishu_card.py`

### 凭证

按以下优先级自动获取(从高到低):
1. 命令参数:`--app-id` / `--app-secret`
2. 环境变量:`FEISHU_APP_ID` / `FEISHU_APP_SECRET`
3. OpenClaw 配置:`/root/.openclaw/openclaw.json` 的 `channels.feishu.accounts`
   - 可用 `--account-id` 指定账户(不传则取第一个)
   - 可用 `--account-id current` 自动读取会话上下文 account_id(从运行时环境变量 best-effort 获取)

### 常用命令

```bash
# 1) 列出内置模板
python3 scripts/send_feishu_card.py --list-templates

# 2) 用 movie 模板发送到 open_id(变量文件)
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"
python3 scripts/send_feishu_card.py \
  --template movie \
  --receive-id ou_xxx \
  --receive-id-type open_id \
  --vars-file references/vars.example.env

# 3) 直接指定模板文件 + 行内变量
python3 scripts/send_feishu_card.py \
  --template-file assets/templates/movie.json \
  --receive-id ou_xxx \
  --var title='星际穿越' \
  --var rating='8.7'

# 4) 只有海报 URL 时,自动上传飞书并注入 poster_img_key
python3 scripts/send_feishu_card.py \
  --template movie-custom \
  --receive-id ou_xxx \
  --receive-id-type open_id \
  --poster-url 'https://image.tmdb.org/t/p/original/xxx.jpg' \
  --var title='星际穿越' \
  --var overview='...'
```

## 变量替换规则

- 模板中占位符写法:`${key}`
- 变量来源(后者覆盖前者):
  1) `--vars-file`(`KEY=VALUE`)
  2) 多次 `--var key=value`
- 未提供的变量保持原样,不报错(便于渐进调试)

## 参数规范(必读)

发送前先读:
- `references/template-params.md`(movie-cus...

Skills associés

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.