飛書圖片訊息

👤 imbing 📦 v1.0.0 ⭐ 4.5 ⬇️ 2.2K 下載
📄 辦公效率 免費 🔑 需 API Key

📖 技能介紹


name: feishu-img-msg description: | 飛書圖片訊息操作技能,當觸發飛書傳送圖片時自動呼叫本技能。 支援上傳圖片、傳送圖片訊息、獲取圖片內容。 Activate when user mentions: 飛書發圖、傳送圖片、上傳圖片、獲取圖片、下載圖片、image_key。


飛書圖片訊息操作技能

本技能提供飛書圖片訊息的完整操作能力,包括上傳、傳送、獲取圖片。

功能

功能 命令 說明
上傳圖片 feishu-img-msg upload 上傳本地圖片到飛書,返回 image_key
傳送圖片 feishu-img-msg send 傳送圖片到指定會話(支援檔案路徑或 image_key)
獲取圖片 feishu-img-msg get 下載飛書圖片到本地
檢視圖片 feishu-img-msg view 獲取圖片資訊(返回 base64 供 AI 檢視)

快速使用

1. 傳送本地圖片到會話

# 直接傳送本地圖片檔案
python3 ~/.openclaw/workspace/skills/feishu-img-msg/scripts/feishu_image.py \
  send \
  --chat-id "oc_xxxxx" \
  --file "/path/to/image.jpg"

2. 上傳圖片獲取 image_key

# 上傳圖片,返回 image_key
python3 ~/.openclaw/workspace/skills/feishu-img-msg/scripts/feishu_image.py \
  upload \
  --file "/path/to/image.png"

3. 用 image_key 傳送圖片

# 使用已有的 image_key 傳送
python3 ~/.openclaw/workspace/skills/feishu-img-msg/scripts/feishu_image.py \
  send \
  --chat-id "ou_xxxxx" \
  --image-key "img_xxxxx"

4. 下載圖片

# 下載飛書圖片到本地
python3 ~/.openclaw/workspace/skills/feishu-img-msg/scripts/feishu_image.py \
  get \
  --image-key "img_xxxxx" \
  --output "/path/to/save.jpg"

5. 檢視圖片內容(AI 可讀)

# 獲取圖片 base64,用於 AI 分析
python3 ~/.openclaw/workspace/skills/feishu-img-msg/scripts/feishu_image.py \
  view \
  --image-key "img_xxxxx"

引數說明

send 命令

引數 必填 說明
--chat-id 接收者 ID(群聊 oc_ 開頭,使用者 ou_ 開頭)
--file 二選一 本地圖片檔案路徑
--image-key 二選一 已上傳的 image_key
--chat-type 會話型別:group(預設) 或 user
--account 飛書賬戶名(預設 main)

upload 命令

引數 必填 說明
--file 本地圖片檔案路徑
--account 飛書賬戶名(預設 main)

get 命令

引數 必填 說明
--image-key 圖片的 image_key
--output 儲存路徑
--account 飛書賬戶名(預設 main)

view 命令

引數 必填 說明
--image-key 圖片的 image_key
--account 飛書賬戶名(預設 main)

支援的圖片格式

  • JPEG (.jpg, .jpeg)

    小蔥技能站7w4.net發現了升級外掛。

  • PNG (.png)
  • GIF (.gif)
  • BMP (.bmp)
  • WebP (.webp)

檔案大小限制:單張圖片最大 30MB

許可權要求

Scope 用途
im:resource 上傳圖片、獲取圖片
im:message 傳送訊息
im:message:send_as_bot 以機器人身份傳送

常見問題

圖片傳送失敗

  1. 檢查 chat-id 型別
  2. 群聊 ID 以 oc_ 開頭,chat_type 設為 group
  3. 使用者 ID 以 ou_ 開頭,chat_type 設為 user

  4. 檢查圖片格式

  5. 支援常見圖片格式
  6. 確保檔案未損壞

  7. 檢查許可權

  8. 機器人需要已加入目標群聊
  9. 機器人需要與使用者有單聊會話

token 過期

指令碼會自動重新整理 tenant_access_token,如仍報錯: - 錯誤碼 99991400 - token 過期,稍後重試 - 錯誤碼 99991401 - token 無效,檢查 app 配置

參考文件

  • 飛書上傳圖片 API: https://open.feishu.cn/document/server-docs/im-v1/image/create
  • 飛書獲取圖片 API: https://open.feishu.cn/document/server-docs/im-v1/image/get
  • 飛書傳送訊息 API: https://open.feishu.cn/document/server-docs/im-v1/message/create

🤖 AI 評測

這個 Skill 功能齊全,能滿足飛書圖片的上傳、傳送、下載等常見需求。文件說明詳細,配有多個使用示例,上手難度低。存在一些小問題:沒有附帶測試用例,部分邊界情況的穩定性未知;程式碼中關閉了證書驗證,可能影響安全性。總體而言質量中上,核心功能實現完整,但測試覆蓋和安全加固方面還有改進空間。

📊 多維度評分

適應性4.4
規範性4.3
有效性4.5
可靠性4.5
可信度5

📁 包含檔案 (4 個)

📄 SKILL.md 4 KB
📄 _meta.json 133 B
📄 scripts/feishu_image.py 13.6 KB
📄 skill-card.md 2.7 KB