name: chat-image-reader description: First universal image reader for 10+ chat platforms. Features: (1) Auto platform detection (Feishu, DingTalk, WeChat, Discord, Telegram, WhatsApp, Slack, Signal, LINE, iMessage), (2) Unified API with platform-specific download logic, (3) Comprehensive API reference with error codes and rate limits, (4) Fallback strategies for missing images. Triggers: "識別圖片", "讀取圖片", "analyze image", "read image from chat". No similar skill exists on ClawHub - fills a unique gap for cross-platform chat image analysis. author: Qingyu Zhu homepage: https://clawhub.ai metadata: openclaw: emoji: "🖼️" requires: bins: - python3 env: - FEISHU_APP_ID - FEISHU_APP_SECRET - DINGTALK_APP_KEY - DINGTALK_APP_SECRET - WECHAT_CORP_ID - WECHAT_CORP_SECRET - TELEGRAM_BOT_TOKEN - DISCORD_BOT_TOKEN envOptional: - DASHSCOPE_API_KEY - BAIDU_API_KEY - BAIDU_SECRET_KEY primaryEnv: FEISHU_APP_ID networkAccess: true permissions: - "Read chat messages" - "Download message attachments" - "Access platform APIs"
7w4.net小蔥技能站收錄全網優質技能,值得收藏。
Universal image reading and analysis skill for multiple chat platforms.
| Platform | Channel | Image Source | Download Method |
|---|---|---|---|
| Feishu (飛書) | feishu | Message image_key | API + Tenant Token |
| DingTalk (釘釘) | dingtalk | Message downloadCode | API + Access Token |
| WeChat (微信) | Media file_id | API + Access Token | |
| Discord | discord | Attachment URL | Direct download |
| Telegram | telegram | file_id | Bot API |
| Media URL | Direct download | ||
| Signal | signal | Attachment | Direct download |
| Slack | slack | File URL | Direct download |
| iMessage | imessage | Attachment path | Local file |
| LINE | line | Message content | API |
This skill requires API credentials to access chat platform messages. Configure at least one platform to use the skill.
| Platform | Required Environment Variables | Notes |
|---|---|---|
| Feishu (飛書) | FEISHU_APP_ID, FEISHU_APP_SECRET |
Required scopes: im:message:readonly, im:resource |
| DingTalk (釘釘) | DINGTALK_APP_KEY, DINGTALK_APP_SECRET |
Required permissions: IMessage, Chat |
| WeChat (企業微信) | WECHAT_CORP_ID, WECHAT_CORP_SECRET |
Required permissions: media_get |
| Telegram | TELEGRAM_BOT_TOKEN |
From @BotFather |
| Discord | DISCORD_BOT_TOKEN |
From Discord Developer Portal |
WHATSAPP_TOKEN |
From Meta Business API |
# Feishu (飛書) - Required for Feishu image reading
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"
# DingTalk (釘釘) - Required for DingTalk image reading
export DINGTALK_APP_KEY="dingxxx"
export DINGTALK_APP_SECRET="xxx"
# WeChat (企業微信) - Required for WeChat image reading
export WECHAT_CORP_ID="xxx"
export WECHAT_CORP_SECRET="xxx"
# Telegram - Required for Telegram image reading
export TELEGRAM_BOT_TOKEN="123456:ABC-xxx"
Check inbound_meta.channel or inbound_meta.provider to determine the chat platform:
{
"channel": "feishu", // Feishu
"channel": "discord", // Discord
"channel": "telegram", // Telegram
"channel": "whatsapp", // WhatsApp
...
}
message_id and image_key from messageGET /open-apis/im/v1/messages/{message_id}/resources/{image_key}downloadCode from message contentGET /v1.0/robot/messageFiles/download?downloadCode={code}media_id from messageGET https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token={token}&media_id={id}file_id from messageGET https://api.telegram.org/bot{token}/getFile?file_id={file_id}https://api.telegram.org/file/bot{token}/{file_path}If user provides a local path directly: 1. Verify file exists 2. Use directly without download
Use the image tool with appropriate prompt:
image(
image: "<local_path_or_url>",
prompt: "描述圖片內容,包括文字、圖表、資料等關鍵資訊"
)
# 1. Get tenant token
$body = @{ app_id = $appId; app_secret = $appSecret } | ConvertTo-Json
$token = (Invoke-RestMethod -Uri "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" -Method Post -Body $body).tenant_access_token
# 2. Get message to find image_key
$message = Invoke-RestMethod -Uri "https://open.feishu.cn/open-apis/im/v1/messages/$messageId" -Headers @{ Authorization = "Bearer $token" }
$imageKey = $message.data.items[0].body.content | ConvertFrom-Json | Select-Object -ExpandProperty image_key
# 3. Download image
Invoke-WebRequest -Uri "https://open.feishu.cn/open-apis/im/v1/messages/$messageId/resources/$imageKey" -Headers @{ Authorization = "Bearer $token" } -OutFile $outputPath
# 1. Get access token
$body = @{ appKey = $appKey; appSecret = $appSecret } | ConvertTo-Json
$token = (Invoke-RestMethod -Uri "https://api.dingtalk.com/v1.0/oauth2/accessToken" -Method Post -Body $body).accessToken
# 2. Download image using downloadCode
# For robot messages:
Invoke-WebRequest -Uri "https://api.dingtalk.com/v1.0/robot/messageFiles/download?downloadCode=$downloadCode" -Headers @{ "x-acs-dingtalk-access-token" = $token } -OutFile $outputPath
# For user messages (via stream):
# Use conversation message download API
# 1. Get access token
$token = (Invoke-RestMethod -Uri "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$corpId&corpsecret=$corpSecret").access_token
# 2. Download media
Invoke-WebRequest -Uri "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=$token&media_id=$mediaId" -OutFile $outputPath
# Discord attachments are direct URLs
$attachmentUrl = $message.attachments[0].url
Invoke-WebRequest -Uri $attachmentUrl -OutFile $outputPath
# 1. Get file path from file_id
$fileInfo = Invoke-RestMethod -Uri "https://api.telegram.org/bot$token/getFile?file_id=$fileId"
$filePath = $fileInfo.result.file_path
# 2. Download file
Invoke-WebRequest -Uri "https://api.telegram.org/file/bot$token/$filePath" -OutFile $outputPath
When user replies to an image message:
reply_to_id in inbound metadata識別圖片中的所有文字內容,保持原有格式和層次結構。
分析圖片中的圖表或表格,提取所有資料和標籤。
描述介面佈局、功能按鈕、當前狀態等關鍵資訊。
識別股票程式碼、價格、K線形態、成交量等財務資訊。
提取招聘資訊,包括職位名稱、職責、要求、薪資等關鍵內容。
描述圖片內容,包括主要元素、文字、資料等關鍵資訊。
| Error | Cause | Solution |
|---|---|---|
| Image not found | No image in message | Ask user to resend or provide path |
| Download failed | Permission/Network issue | Check permissions, retry |
| API error | Token expired/invalid | Refresh token and retry |
| Analysis failed | Image unclear/unsupported | Try alternative prompt |
When automatic image retrieval fails:
$workspace/temp_images/ or system tempimg_{channel}_{timestamp}.jpgFEISHU_APP_ID / channels.feishu.appIdFEISHU_APP_SECRET / channels.feishu.appSecretim:message:readonly, im:resourceDINGTALK_APP_KEY / channels.dingtalk.appKeyDINGTALK_APP_SECRET / channels.dingtalk.appSecretIMessage, ChatWECHAT_CORP_ID / channels.wechat.corpIdWECHAT_CORP_SECRET / channels.wechat.corpSecretmedia_get