Token导航 LogoToken导航TokenDH.com
图像处理敏感数据clawhub未标认证来源可访问clear审计提醒

send-feishu-image发送飞书图片

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

2,571

周安装

104

GitHub Stars

公开资料未说明

下载量

807
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:send-feishu-image(发送飞书图片)
来源仓库:https://github.com/jamesqin-cn/send-feishu-image
安装命令:
openclaw skills install send-feishu-image
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install send-feishu-image

简介

通过 API 上传获取 image_key,然后使用 URL 查询中的 receive_id_type 发送图像消息,从而在飞书聊天中内嵌发送图像。

SKILL.md

name
feishu-image-send
description
Send inline images via Feishu Bot messages. Use when the message tool's filePath/file_path parameters fail to render images (shows JSON text instead). Works by generating a temporary Node.js script that calls the Feishu Open API directly (upload image → get image_key → send image message). Trigger: sending images to Feishu chat, image rendering fails, or user asks to send a picture via Feishu bot.

Feishu Image Send

Send images that render inline in Feishu chat (not as file links).

Problem

The message tool's filePath/file_path parameters often fail for Feishu:

  • API returns ok:true but the recipient sees raw JSON text instead of rendered image
  • Caused by path restrictions (mediaLocalRoots) and outbound handling bugs
  • This skill bypasses the issue by calling the Feishu Open API directly

Workflow

When asked to send an image to a Feishu chat:

  1. Get the image path and target user/chat
  2. Generate a temporary Node.js script with values filled in (see Template below)
  3. Write it to /tmp/feishu-send-{timestamp}.js using write
  4. Run: node /tmp/feishu-send-{timestamp}.js
  5. Confirm ✅ Image sent in output, then clean up: rm /tmp/feishu-send-{timestamp}.js

Script Template

Copy this template and fill in the values:

const https = require('https');
const fs = require('fs');

// === Config: update these values ===
const APP_ID = '<app_id>';             // e.g. cli_a931e5b57ff89cc0
const APP_SECRET = '<app_secret>';     // from openclaw.json
const IMAGE_PATH = '/absolute/path/to/image.jpg';  // must be absolute
const RECEIVE_ID = '<open_id_or_chat_id>';           // e.g. ou_71c53ff7589f8527a27c2a057b96b6d7
const RECEIVE_ID_TYPE = 'open_id';     // or 'chat_id', 'user_id'
// ===================================

function req(url, opts, body) {
  return new Promise((resolve, reject) => {
    const u = new URL(url);
    const r = https.request({
      hostname: u.hostname,
      path: u.pathname + u.search,
      method: opts.method || 'GET',
      headers: opts.headers || {}
    }, res => {
      let d = ''; res.on('data', c => d += c);
      res.on('end', () => { try { resolve(JSON.parse(d)) } catch (e) { resolve(d) } });
    });
    r.on('error', reject);
    if (body) r.write(typeof body === 'string' ? body : JSON.stringify(body));
    r.end();
  });
}

(async () => {
  // 1. Get tenant access token
  const t = await req('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' }
  }, { app_id: APP_ID, app_secret: APP_SECRET });
  if (t.code !== 0) { console.error('Token error:', t); process.exit(1); }
  const token = t.tenant_access_token;
  console.log('Token acquired');

  // 2. Upload image via multipart/form-data
  const boundary = '----Boundary' + Date.now().toString(36);
  const CRLF = '\
\
';
  const img = fs.readFileSync(IMAGE_PATH);
  const fn = IMAGE_PATH.split('/').pop();
  const body = Buffer.concat([
    Buffer.from(`--${boundary}${CRLF}`),
    Buffer.from(`Content-Disposition: form-data; name="image_type"${CRLF}${CRLF}message${CRLF}`),
    Buffer.from(`--${boundary}${CRLF}`),
    Buffer.from(`Content-Disposition: form-data; name="image"; filename="${fn}"${CRLF}`),
    Buffer.from(`Content-Type: image/jpeg${CRLF}${CRLF}`),
    img,
    Buffer.from(`${CRLF}--${boundary}--${CRLF}`),
  ]);
  const uploaded = await new Promise((resolve, reject) => {
    const r = https.request({
      hostname: 'open.feishu.cn',
      path: '/open-apis/im/v1/images',
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': `multipart/form-data; boundary=${boundary}`,
        'Content-Length': body.length
      }
    }, res => {
      let d = ''; res.on('data', c => d += c);
      res.on('end', () => { try { resolve(JSON.parse(d)) } catch (e) { reject(e) } });
    });
    r.on('error', reject); r.write(body); r.end();
  });
  if (uploaded.code !== 0) { console.error('Upload error:', uploaded); process.exit(1); }
  const imageKey = uploaded.data.image_key;
  console.log('Image uploaded, key:', imageKey);

  // 3. Send image message
  // ⚠️ RECEIVE_ID_TYPE must be in URL query string, NOT in JSON body
  const content = JSON.stringify({ image_key: imageKey });
  const sent = await req(
    `https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=${encodeURIComponent(RECEIVE_ID_TYPE)}`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json; charset=utf-8'
      }
    },
    { receive_id: RECEIVE_ID, msg_type: 'image', content }
  );
  if (sent.code !== 0) { console.error('Send error:', sent); process.exit(1); }
  console.log('✅ Image sent. message_id:', sent.data.message_id);
})();

Critical Rules

RuleDetail
receive_id_typeMust be a URL query parameter (?receive_id_type=open_id), not in the JSON body
image_type in uploadUse "message" for chat images, not "avatar"
content field in sendMust be a JSON string (double-escaped), not an object
IMAGE_PATHMust be an absolute path to a readable image file

Getting Credentials

Read openclaw.jsonchannels.feishu.accounts.<accountId> for appId and appSecret.

For the CTO agent, these are already known:

  • accountId: cto
  • appId: cli_a931e5b57ff89cc0
  • appSecret: Q3c78ab1ORB7xOj0JtRz2d1GwQtzZcZH

For the target user, use the current conversation's sender open_id from the inbound context.

Supported Formats

JPEG, PNG, GIF, WEBP, TIFF, BMP, ICO — max 30MB.

Common Pitfalls

SymptomCauseFix
99992402 field validation failed for receive_id_typeParameter placed in JSON body instead of URLMove receive_id_type=open_id to the URL query string
234011 Can't recognize image formatCorrupted, missing, or unsupported fileEnsure valid JPEG/PNG and file exists at the given path
Image uploads but not displayed in chatUsed image_type=avatar instead of messageChange image_type to "message" for chat images
message tool returns ok but no image rendersfilePath not in mediaLocalRoots or outbound bugUse this skill's direct API method instead

Integration with Cron Jobs

In automated reports (daily/weekly), generate and run the script programmatically:

const { writeFileSync, unlinkSync } = require('fs');
const { execSync } = require('child_process');
const path = '/tmp/feishu-send-' + Date.now() + '.js';

const script = `/* filled template */`;
writeFileSync(path, script);
execSync(`node ${path}`);
unlinkSync(path);

API Reference

  • Upload Image: POST /open-apis/im/v1/images (multipart/form-data)
  • Send Message: POST /open-apis/im/v1/messages?receive_id_type={type} (JSON body)

Official docs:

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

75.37%
按下载量换算608

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills