cap_im_platform
GitHub指导Agent通过飞书、QQ、Telegram和微信等IM渠道发送文本、图片或本地文件。涵盖渠道选择、目标地址处理及媒体类型判断规则,确保消息准确送达。
Trigger Scenarios
Install
npx skills add espressif/esp-claw --skill cap_im_platform -g -y
SKILL.md
Frontmatter
{
"name": "cap_im_platform",
"metadata": {
"cap_groups": [
"cap_im_feishu",
"cap_im_qq",
"cap_im_tg",
"cap_im_wechat"
],
"manage_mode": "readonly"
},
"description": "How to send additional text, images, or local files back to IM chats."
}
IM Messaging
Use this skill only when the user asks to send an extra text message, image, or local file through an IM channel. Normal agent replies are sent automatically and do not need IM send tools.
Channel Selection
Prefer the current request source_cap. Do not send through another IM channel unless the user explicitly asks. Do not invent a target chat when the current context or user request does not provide one.
| Channel | Text | Image | File | Chat target |
|---|---|---|---|---|
Feishu cap_im_feishu |
feishu_send_message |
feishu_send_image |
feishu_send_file |
May omit chat_id for current inbound replies when context has it. Explicit targets may be Feishu chat_id values, or user open_id values beginning with ou_. |
QQ cap_im_qq |
qq_send_message |
qq_send_image |
qq_send_file |
May omit chat_id for current inbound replies when context has it. Explicit targets are normalized as c2c:<openid> or group:<group_openid>. |
Telegram cap_im_tg |
tg_send_message |
tg_send_image |
tg_send_file |
May omit chat_id for current inbound replies when context has it. Explicit targets are numeric strings such as 123456789 or -1001234567890. |
WeChat cap_im_wechat |
wechat_send_message |
wechat_send_image |
Not supported | Always requires explicit chat_id; the callable implementation does not fall back to runtime context. Preserve concrete room or contact ids exactly. |
Chat Targets
For Feishu, QQ, and Telegram, pass explicit chat_id when starting a new outbound send or when the target would otherwise be ambiguous. For WeChat, always pass chat_id.
Rules
- Call the direct channel capability: text tools for text, image tools for image files, and file tools for local non-image files.
- For WeChat, always pass
chat_idand use onlywechat_send_messageorwechat_send_image; generic non-image file send is not available. - Use image tools for
.jpg,.jpeg,.png,.gif, or.webp. Use file tools for non-image files such as.txt,.json,.log,.csv,.pdf, or archives. pathmust be a real local device path. If unknown, inspect storage first with file tools such aslist_dir.- Do not pass remote URLs directly to IM send tools. Download or locate the file on local storage first.
- In this demo app, inbound IM attachments are typically saved under
<storage_root>/inbox. captionis optional for image and file sends. For Feishu media sends, caption is delivered as a follow-up text message.- Feishu text is sent through a Markdown-capable interactive card when possible, with fallback to plain text if card construction or delivery fails.
- If the send tool returns an error, report the error directly. Do not retry or switch channels unless the user asks.
- If a capability returns success text or JSON such as
{"ok":true}, tell the user the message or file has already been sent; do not phrase it as pending. - QQ generic file delivery may still depend on QQ platform-side support. If
qq_send_filefails, report the failure clearly and only consider image send when the file is actually an image.
Workflow
- Confirm the target channel from
source_capor the user's explicit request. - Determine whether the user wants text, an image, or a generic file.
- Resolve the target chat according to the channel rules above.
- Resolve the local file path when sending media.
- Call the matching send capability directly.
- After success, tell the user the message, image, or file has already been sent.
Examples
Reply with text to the current QQ, Feishu, or Telegram chat:
{
"message": "The task has been completed."
}
Send text to an explicit Feishu user:
{
"chat_id": "ou_xxx123456",
"message": "Latest status: device is online."
}
Send an image to an explicit Telegram chat:
{
"chat_id": "-1001234567890",
"path": "<storage_root>/inbox/capture.jpg",
"caption": "Here is the image."
}
Send a file to an explicit Feishu chat:
{
"chat_id": "oc_xxx123456",
"path": "<storage_root>/reports/status.json",
"caption": "Latest report."
}
Send text to a WeChat chat:
{
"chat_id": "room123",
"message": "Latest status: device is online."
}
Version History
- 06eb576 Current 2026-07-24 19:54


