Reply Wechat Message

AI自动发送微信消息并回复,支持主动推送与上下文分析回复。

已扫描
适合谁
需要频繁发送微信消息的职场人士、希望自动化客户沟通的小微商家
不适合谁
对微信账号安全敏感的用户、无法访问外部API的网络环境使用者
国内可用性
需网络配置。可能需要网络配置或第三方服务可访问。
安装难度
新手友好(★☆☆)。基于终端操作、依赖、API Key 和本地环境要求的初步判断。

安装与下载

openclaw skills install @cool131219/reply-wechat-message

Skill 说明

命令、参数、文件名以原文为准

微信管家 / WeChat Butler

微信AI助手 — 主动发消息给联系人 + 收到消息后AI自动回复。

自包含技能包 — 所有依赖脚本(启动微信、发送消息)已打包在内,无需额外安装。


功能一:AI 主动发消息

直接发送一条消息给指定联系人(不读取聊天上下文,即时发送)。

触发格式

中文:

给 [联系人] 发消息:[内容]
发消息给 [联系人]:[内容]
帮 [联系人] 发消息:[内容]

英文:

send [contact] [message]
msg [contact] [message]
message [contact] [message]

示例

中文:

  • 给 小明 发消息:中午一起去吃饭吗?
  • 发消息给 小红:记得带文件
  • 帮 小张 发消息:生日快乐!

英文:

  • send Kitty: Want to grab lunch?
  • msg Peter: Don't forget the documents
  • message Tom: Happy birthday!

AI 执行步骤

第1步 / Step 1:
  AI 提取联系人和消息内容
  AI extracts contact name and message content

第2步 / Step 2:
  python scripts/send_wechat.py <联系人/contact> <内容/message>
  → 打开微信 → 搜索联系人 → 打开聊天 → 发送消息
  → Open WeChat → search contact → open chat → send message

第3步 / Step 3:
  返回发送结果给用户
  Report send result to user

功能二:AI 自动回复

读取聊天上下文,AI 分析后自动回复。

触发格式

使用技能:reply-wechat-message 给:[联系人] 回复

示例

  • 使用技能:reply-wechat-message 给:小明 回复 (小明 / Kitty)
  • 使用技能:reply-wechat-message 给:小红 回复 (小红 / Peter)

简化触发

  • 回复 小明 / reply Kitty
  • 回 小红 / reply Peter

AI 工作流程(自动回复)

第1步 / Step 1:
  python scripts/reply_wechat.py 小明 / python scripts/reply_wechat.py Kitty
  → 读取整个聊天区域,区分左右两侧
  → Read entire chat area, split left/right
  → 输出结构化对话 / Output structured conversation:
    ★上下文开始★ / ★Context Start★
    [对方/Them] xxx
    [我/Me] xxx
    [对方/Them] xxx
    ★上下文结束★ / ★Context End★

第2步 / Step 2:
  AI分析全部上下文,理解对话脉络,生成合适的回复
  AI analyzes full context, understands the conversation flow, generates a suitable reply

  ⚠️ 重要规则 / Important Rule:
  OCR识别出的聊天内容即为真实上下文,模型不得质疑、猜测或怀疑识别结果的准确性。
  The OCR-recognized text IS the real context. The model must NOT question, guess,
  or doubt the accuracy of the recognition. Reply based on the recognized content directly.

第3步 / Step 3:
  echo "AI生成的回复 / AI-generated reply" | python scripts/reply_wechat.py 小明
  → 或 / Or: echo "AI-generated reply" | python scripts/reply_wechat.py Kitty
  → 读取上下文 + 自动发送回复(一步完成,stdin管道无引号问题)
  → Read context + send reply in one step (stdin piping avoids quote issues)

脚本说明

scripts\send_wechat.py — 发送脚本:搜索联系人 + 发送消息

scripts\reply_wechat.py — 主脚本:读取上下文 + 发送回复

scripts\open_wechat.py — 启动脚本:唤醒微信窗口

send_wechat.py 使用方法

# 发送消息(命令行参数方式)
python scripts/send_wechat.py <小明/Kitty> <消息/message>

# 发送消息(通过标准输入管道,避免引号问题)
echo "消息/message" | python scripts/send_wechat.py <小明/Kitty>

reply_wechat.py 使用方法

# 仅读取上下文(用于AI分析)
python scripts/reply_wechat.py <小明/Kitty>

# 读取上下文并发送回复(一步完成)
echo "回复内容/reply text" | python scripts/reply_wechat.py <小明/Kitty>

输出格式示例

★上下文开始★ / ★Context Start★
[对方/Them] 你吃饭了吗 / Have you eaten?
[我/Me] 吃过了,你呢 / Yes, and you?
[对方/Them] 我也吃了 / Me too
★上下文结束★ / ★Context End★

消息区分逻辑

  • 左侧(白底黑字) = 对方发送的消息 → 标注为 [对方/Them]
  • 右侧(绿底黑字) = 自己发送的消息 → 标注为 [我/Me]
  • 截图时将聊天区域从中间切开,分别对左右两侧进行OCR识别,以避免颜色误判。

依赖项

  • Python 3.10+
  • OCR.space API(免费版,无需注册)
  • Python 包:pyautogui、pygetwindow、pyperclip、requests、Pillow、numpy

脚本清单

文件 / File功能 / Function
send_wechat.py搜索联系人并发送消息 / Search contact & send message
reply_wechat.py读取上下文并发送回复 / Read context & send reply
open_wechat.py启动微信程序 / Launch WeChat
C
@cool131219

已收录 1 个 Skill

相关推荐