send-to-wechat

Send local files to the user's WeChat via the OpenClaw openclaw-weixin channel.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "send-to-wechat" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-574d5b981f64c567df40c54d516ab53b6cdef3936b2e3fe84acadbcc678bde12. Verify the upstream source and version against https://skillhub.cn/skills/user_46974ee3/send-to-wechat before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Send local files to the user's WeChat via the OpenClaw openclaw-weixin channel.

0 Downloads

Introduction source: third_party · user_46974ee3 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: send-to-wechat
slug: send-to-wechat
displayName: 发送到微信
description: 发送本地文件到用户微信(通过 OpenClaw openclaw-weixin 通道)。
status: live
version: "1.0.0"
date: "2026-07-02"

send-to-wechat

把本地文件发送到用户微信(通过 OpenClaw openclaw-weixin 通道)。

触发场景

  • 用户说「发微信」「发到我微信」「微信发给我」「send to wechat」
  • 用户想把本地任意文件(PDF / docx / 图片 / 压缩包等)推送到自己的微信

前置条件

  1. OpenClaw 已配置 openclaw-weixin 通道(用户已绑定微信)
  2. 配置文件位置:C:\Users\<user>\.qclaw\openclaw-weixin\accounts\<bot-id>-im-bot.json
  3. 文件大小建议 < 25 MB(微信限制)

核心动作

只有一步:调用 message 工具发送文件

message(
  action="send",
  channel="openclaw-weixin",
  target=<从 accounts 配置读取的 userId>,
  media=<文件绝对路径,用正斜杠 / >,
  filename=<文件名>,
  message=<可选的文字说明>
)

步骤 1:读取微信 target(userId)

从 ~/.qclaw/openclaw-weixin/accounts/ 读取最新的 bot 配置:

import os, glob, json

def get_wechat_target():
    """从 openclaw-weixin accounts 目录读取最新的 userId"""
    accounts_dir = os.path.expanduser(r'~\.qclaw\openclaw-weixin\accounts')
    if not os.path.isdir(accounts_dir):
        return None
    # 找 *-im-bot.json 文件(不是 .sync.json 或 .context-tokens.json)
    files = sorted(
        glob.glob(os.path.join(accounts_dir, '*-im-bot.json')),
        key=os.path.getmtime,
        reverse=True
    )
    for f in files:
        with open(f, 'r', encoding='utf-8') as fp:
            data = json.load(fp)
            uid = data.get('userId')
            if uid:
                return uid
    return None

返回值形如:o9cq80_gPztSv6T0j2O0huaLEEKI@im.wechat

步骤 2:调用 message 工具发送

message(action=send,
  channel="openclaw-weixin",
  target=<step1 的 userId>,
  media="C:/path/to/file.pdf",     # 注意:用正斜杠 /
  filename="file.pdf",
  message="可选的文字说明"
)

步骤 3:判断结果

  • 成功:返回值包含 result.messageId,格式形如 openclaw-weixin:<timestamp>-<hash>
  • 失败:返回值 result.ok 为 false,或返回 error

成功后告诉用户:「✅ 已发送,请查收微信」。

⚠️ 关键约束

通道选择

  • 必须用 openclaw-weixin(这是绑定用户微信的真正通道)
  • 不要用 wechat-access(那是另一个未启用的旧配置,发了用户也收不到)

target 格式

  • target 是 userId(格式 o9cq80_xxxx@im.wechat),不是数字 ID
  • 数字 ID(如 1832932455)是 wechat-access 通道用的,不要混用

media 路径

  • 用正斜杠 /,不要用反斜杠 \
  • 用绝对路径,不要用相对路径

文件大小

  • 建议单文件 < 25 MB
  • 25 MB 可能发送失败,需拆分或上传云盘

完整调用示例(Python 准备 target,message 工具发送)

import os, glob, json

# 1. 读 target
accounts_dir = os.path.expanduser(r'~\.qclaw\openclaw-weixin\accounts')
files = sorted(glob.glob(os.path.join(accounts_dir, '*-im-bot.json')), key=os.path.getmtime, reverse=True)
target = None
for f in files:
    with open(f, 'r', encoding='utf-8') as fp:
        data = json.load(fp)
        if data.get('userId'):
            target = data['userId']
            break

print(f'target: {target}')
print(f'file: C:/Users/26612/Desktop/plc/PLC零基础速成教学.pdf')

然后调用 message 工具:

message(action=send,
  channel="openclaw-weixin",
  target=target,
  media="C:/Users/26612/Desktop/plc/PLC零基础速成教学.pdf",
  filename="PLC零基础速成教学.pdf",
  message="教学文档 PDF"
)

常见问题

Q1: message 返回 ok 但用户没收到

  • 检查 channel 是不是 openclaw-weixin(不是 wechat-access)
  • 检查 target 是不是从 accounts/*-im-bot.json 里读的 userId(不是数字 ID)

Q2: 找不到 accounts 目录

  • 路径:C:\Users\<user>\.qclaw\openclaw-weixin\accounts\
  • 如果目录不存在,说明用户还没绑定微信,需要先在 QClaw 客户端绑定

Q3: 文件太大发不出

  • 微信限制约 25 MB
  • 解决方案:压缩、拆分、或上传云盘发链接

Q4: 多个 bot 配置选哪个

  • 按 mtime 排序选最新的(sorted(..., key=os.path.getmtime, reverse=True)[0])

适用文件类型

PDF / docx / xlsx / pptx / png / jpg / mp3 / mp4 / zip 等常见格式都支持。

限制

  • 需要用户已绑定微信(openclaw-weixin 通道已配置)
  • 单文件 < 25 MB
  • 不能主动发消息给未绑定用户
  • 不能发到群聊(只能发到绑定的微信账号)

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决用户将本地文件快速推送至微信的高频刚需场景
  • 功能定位清晰,非测试或同质化壳工具
Trigger Precision90/100

Highlights

  • 触发词覆盖多种自然语言变体,边界清晰
  • 无歧义或与其他 Skill 重叠风险
Structure and Standards95/100

Highlights

  • 文档结构完整,含前置条件、步骤、约束、示例、FAQ
  • frontmatter 规范,示例详实
Execution Reliability90/100

Highlights

  • 工具调用参数明确,关键约束(路径格式、文件大小)清晰
  • 覆盖主要异常场景(目录不存在、target 读取失败)
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.