Prototyp · Vorschau: alle Server aus der offiziellen Registry, alle 30 Minuten synchronisiert. Mit Google anmelden, um Bewertungen zu schreiben.Prototyp · alle 30 Min. aktualisiert
PopNx MCPMCP-Server für alle, die KI nutzen · in einfachen Worten erklärt

What it does

微信4.x自动化机器人:群聊机器人、批量群发(支持文件)、批量设置群公告、聊天记录导出、群管理 | 5分钟上手

  • Connects Instruction files the AI reads; connects to nothing
  • Account or key No key needed
  • Category Programmieren
Für Anbieter: Badge ins README

Wenn du das gebaut hast, füge diesen Code in dein README ein. Das Badge verlinkt auf diese Seite.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/skill/claw-codes-wx4py.svg)](https://mcp.popnx.com/en/skills/claw-codes-wx4py)

Zusammen nutzen mit

MCP-Server, die die KI für dieselbe Arbeit mit Diensten verbinden

REA

Reverse engineer anything from your terminal or agent with one CLI and MCP server.

von morlutoWeit verbreitet↓ 388.706/Wo.★ 461.796Aktualisiert vor 4 Tagen

MCP · Verbindet einen DienstLäuft auf deinem Computer

Fallow

Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.

von fallow-rsWeit verbreitet↓ 2,4 Mio./Wo.★ 5368Aktualisiert gestern

MCP · Verbindet einen DienstLäuft auf deinem Computer

Desktop Commander

MCP server for terminal commands, file operations, and process management

von wonderwhy-erWeit verbreitet↓ 740.317/Wo.★ 10.318Aktualisiert vor 4 Tagen

MCP · Verbindet einen DienstLäuft auf deinem Computer

Ähnliche Skills

Gleiche Art Arbeit, sortiert wie die Skill-Liste

Im Vergleich mit ähnlichen
Dieser
wx4py
reagraphifyarchifysecurity-audit-skill
Anbieterclaw-codesmorlutoGraphify-Labstt-a1icloudflare
Skills11111
GitHub-Sterne807461.751148.35296.75773.156
Letzte Codeänderung11. Apr. 202616. Nov. 202616. Nov. 202615. Nov. 202615. Sept. 2026
LizenzAGPL-3.0MITApache-2.0Apache-2.0MIT

1 Skills (Anweisungssammlungen) von claw-codes, die eine KI liest und befolgt · kein MCP-Server

Was einen Skill von MCP unterscheidet

MCP = die Hände

Verbindet die KI mit einem externen Dienst oder Daten, etwa Notion lesen oder eine Rechnung erstellen. Ein Programm oder Server muss laufen.

Skill = das Handbuch

Eine Textdatei, die der KI zeigt, wie eine Aufgabe geht. Sie verbindet sich mit nichts.

Manches überschneidet sich: Einige Skills starten Skripte mit Werkzeugen, einige MCP-Server liefern nur Wissen. Geh von der Aufgabe aus.

Funktioniert mit

Claude Code

Laut README des Anbieters und den Ordnern im Repo

Installieren

Is it safe?

  • Who made it

    GitHub account claw-codes (person) is only 7 months old: take extra care

  • Use and upkeep

    ★ 807 stars · code last changed 11. Apr. 2026

  • Any scripts?

    No, plain text files the AI reads and follows

  • Uses the internet?

    No scripts, so it does not go online by itself

  • Changes machine-wide settings?

    No hooks or writes to machine settings found

Checked automatically from the repo files at commit ccbc7c1 (read only, nothing was run). Not a safety guarantee: read it and decide for yourself

Zuerst: Welche KI nutzt du?

Wähle deine App, dann zeigt diese Seite nur die Installation für diese App

Option 1Upload to claude.ai (web and app)

  1. Download from GitHub

    This skill uses the AGPL-3.0 license, which is not on the list we redistribute, so we do not hand out a ZIP from our site. Download it from GitHub and arrange the folder yourself, or use "Let the AI install it" above, which is easier

    Download from GitHub (whole repo) ↗

    Unzip it, then zip only the wx4-skill folder again. The ZIP must have a wx4-skill folder with SKILL.md at the top level, no loose files

  2. Open Skills on claude.ai and upload

    +Create skillUpload a skillpick wx4-skill.zip

    Open claude.ai/customize/skills ↗

  3. No Upload button? Turn on file creation first

    SettingsCapabilitiesCode execution and file creation

    Turn on Code execution and file creation first (newer menus: Create and edit files) · personal plans: Settings → Capabilities · Team/Enterprise: an admin turns it on under Organization settings → Plugins & skills · every plan, including Free

Upload once; it works in claude.ai and Claude Desktop, and in recent Claude Code signed in with a Claude account (not with an API key)

Cowork and cloud sessions use the skills turned on in your claude.ai account, not ~/.claude/skills on your computer (Claude Desktop scheduled tasks run locally and still load it)

Checked against official docs 12. Nov. 2026 · Source: support.claude.com, support.claude.com, code.claude.com

Option 1Claude Code installieren lassen

Kopiere diesen Satz und füge ihn in einen Claude Code-Chat ein

Where to install

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Claude Code neu starten, dann /wx4-skill tippen oder eine passende Aufgabe stellen; Claude nutzt den Skill

Checked against official docs 12. Nov. 2026 · Source: code.claude.com

For Terminal users

Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.

  1. Terminal öffnen

    Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“

  2. Skill-Ordner nach ~/.claude/skills kopieren

    Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer SKILL.md

    Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

  3. Claude Code neu starten, dann /wx4-skill tippen oder eine passende Aufgabe stellen; Claude nutzt den Skill

Selbst installierte Skills funktionieren in der ChatGPT-Desktop-App, in Codex CLI und in der Codex-Erweiterung für die IDE · ChatGPT im Web und auf dem Handy kann selbst installierte Skills nicht nutzen, nur Skills, die mit einem Plugin aus dem Verzeichnis kommen

ChatGPT-Desktop-App

Die ChatGPT-Desktop-App enthält Codex, und Codex liest Skills aus dem Ordner ~/.agents/skills

Option 1ChatGPT installieren lassen

Öffne Codex in der ChatGPT-Desktop-App und füge diesen Satz in den Chat ein

Where to install

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Option 2Ordner selbst ablegen

Lege den Ordner wx4-skill unter ~/.agents/skills/wx4-skill ab

~ ist dein Home-Ordner ($HOME)

For Terminal users

Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.

  1. Terminal öffnen

    Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“

  2. Skill-Ordner nach ~/.agents/skills kopieren

    Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer SKILL.md

    Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

Nach der Installation

  • ChatGPT-Desktop-App: Öffne Skills in der Seitenleiste, um zu sehen, ob der Skill da ist
  • So nutzt du ihn: In ChatGPT @ tippen und den Skill wählen · in Codex CLI oder der IDE-Erweiterung /skills ausführen oder $ und den Skill-Namen tippen
  • Codex erkennt neu installierte Skills selbst; wenn einer nicht erscheint, starte Codex neu

Checked against official docs 15. Nov. 2026 · Source: learn.chatgpt.com

ChatGPT im Web und auf dem Handy

Selbst installierte Skills funktionieren hier nicht, nur Skills, die mit einem Plugin aus dem Verzeichnis kommen

Um diesen Skill mit ChatGPT zu nutzen, verwende die ChatGPT-Desktop-App wie oben beschrieben

Checked against official docs 15. Nov. 2026 · Source: learn.chatgpt.com

Option 1Codex installieren lassen

Kopiere diesen Satz und füge ihn in einen Codex-Chat ein · Funktioniert in Codex in der ChatGPT-Desktop-App, in Codex CLI und in der IDE-Erweiterung

Where to install

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Codex erkennt neu installierte Skills selbst; wenn einer nicht erscheint, starte Codex neu · So nutzt du ihn: In ChatGPT @ tippen und den Skill wählen · in Codex CLI oder der IDE-Erweiterung /skills ausführen oder $ und den Skill-Namen tippen

Checked against official docs 15. Nov. 2026 · Source: learn.chatgpt.com

For Terminal users

Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.

  1. Terminal öffnen

    Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“

  2. Skill-Ordner nach ~/.agents/skills kopieren

    Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer SKILL.md

    Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

  3. Codex neu starten und eine passende Aufgabe stellen; Codex listet den Skill

Option 1Cursor installieren lassen

Kopiere diesen Satz und füge ihn in einen Cursor-Chat ein

Where to install

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Im Agent-Chat von Cursor / tippen und wx4-skill wählen

Checked against official docs 12. Nov. 2026 · Source: cursor.com

For Terminal users

Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.

  1. Terminal öffnen

    Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“

  2. Skill-Ordner nach ~/.cursor/skills kopieren

    Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer SKILL.md

    Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

  3. Im Agent-Chat von Cursor / tippen und wx4-skill wählen

Option 1Let the AI install it

Für andere Apps, die Skills lesen. Der Satz enthält die Pfade für Claude Code, Codex und Cursor, damit die KI den für deine App wählt · Copy this sentence into the app’s chat

Where to install

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

Befehle werden geprüft · Kopier-Buttons erscheinen, sobald sie bestanden sind

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Checked against official docs 12. Nov. 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com

For Terminal users

Andere Apps mit Agent Skills (etwa Gemini CLI oder GitHub Copilot) nutzen andere Ordner. Sieh in deren Anleitung nach und kopiere den Ordner mit der SKILL.md dorthin.

Auf GitHub ansehen ↗

Skill-Ordner am 11. Nov. 2026 mit den offiziellen Anleitungen von Claude Code, Codex und Cursor geprüft

Original-SKILL.md ansehen

Der folgende Text stammt aus dem Repo des Anbieters, nicht von PopNx MCP

Die ersten 8.000 Zeichen · Ganze Datei auf GitHub öffnen

---
name: wx4-skill
description: 微信自动化操作 skill,用于帮助用户快速完成微信消息群发、文件发送、群管理、聊天记录获取、多群监听、AI 自动回复等自动化任务。当用户需要批量发送微信消息、管理微信群、获取聊天记录、监听群消息、或接入 AI 群聊机器人时使用此 skill。
---

# 微信自动化操作 Skill

## ⚠️ 使用前必读:安装检查

**在执行任何操作前,必须先确认 wx4py 库已安装。**

### 步骤1:检查是否已安装

```python
try:
    from wx4py import WeChatClient
    print("✅ wx4py 已安装")
except ImportError:
    print("❌ 未安装 wx4py")
```

### 步骤2:如果未安装,执行安装

```bash
# 方法1:从 PyPI 安装(推荐)
pip install wx4py

# 方法2:从 GitHub 安装(最新版)
pip install git+https://github.com/claw-codes/wx4py.git

# 方法3:从本地安装
cd /path/to/wx4py
pip install .
```

### 步骤3:验证安装成功

```python
from wx4py import WeChatClient

# 测试导入
print("✅ 安装成功!")

# 检查版本(可选)
import wx4py
print(f"版本: {wx4py.__version__}")
```

**重要提示**:
- 如果用户提示 `ModuleNotFoundError: No module named 'wx4py'`,说明未安装
- 必须先安装库再执行后续操作
- 安装只需要一次,后续无需重复

---

## 概述

本 skill 基于 wx4py 库,帮助用户通过 Python 代码自动化控制 Windows 微信客户端,完成重复性的消息发送、群管理等任务。

**适用场景**:
- 批量群发通知到多个群或联系人
- 定时发送文件、图片、消息
- 获取和分析聊天记录
- 管理群公告、群昵称、免打扰等设置
- 监听多个群聊消息,并在被 @ 时自动回复
- 接入 OpenAI 兼容接口或自定义 AI 回调,构建群聊机器人
- 自动化日常微信操作

**前置要求**:
- Windows 系统
- 微信 PC 客户端已安装并登录(Qt 版本,已测试 4.1.7.59、4.1.8.29)
- Python >=3.9
- 终端、编辑器、脚本文件统一使用 UTF-8 编码环境,避免中文消息、群名、文件名出现乱码

**编码环境建议**:
- Python 源码文件保存为 UTF-8
- PowerShell / 终端优先使用 UTF-8 编码
- 读写文本、JSON、Markdown 文件时显式指定 `encoding='utf-8'`
- 如果要输出中文日志或生成中文文件内容,优先验证终端和编辑器都已切换到 UTF-8

## 核心功能

### 1. 消息发送

#### 发送单条消息到联系人或群
```python
from wx4py import WeChatClient

wx = WeChatClient()
wx.connect()

# 发送给联系人
wx.chat_window.send_to("文件传输助手", "测试消息")

# 发送到群
wx.chat_window.send_to("工作群", "下午3点开会", target_type='group')

wx.disconnect()
```

#### 批量群发消息
```python
wx = WeChatClient()
wx.connect()

# 批量发送到多个群
groups = ["群1", "群2", "群3"]
message = "重要通知:明天放假"
wx.chat_window.batch_send(groups, message)

# 批量发送到多个联系人
contacts = ["张三", "李四", "王五"]
wx.chat_window.batch_send(contacts, "周末聚餐通知", target_type='contact')

wx.disconnect()
```

### 2. 文件发送

#### 发送单个文件
```python
wx = WeChatClient()
wx.connect()

# 发送文件给联系人
wx.chat_window.send_file_to("文件传输助手", r"C:\reports\weekly.pdf")

# 发送文件到群
wx.chat_window.send_file_to("工作群", r"C:\data.xlsx", target_type='group', message='可以携带消息')

wx.disconnect()
```

#### 批量发送多个文件
```python
wx = WeChatClient()
wx.connect()

# 发送多个文件
files = [
    r"C:\images\photo1.png",
    r"C:\images\photo2.png",
    r"C:\documents\report.pdf"
]
wx.chat_window.send_file_to("文件传输助手", files)

wx.disconnect()
```

### 3. 聊天记录获取

#### 获取指定时间范围的聊天记录
```python
wx = WeChatClient()
wx.connect()

# 获取今天的聊天记录
messages = wx.chat_window.get_chat_history(
    target="工作群",
    target_type='group',
    since='today'  # 'today' | 'yesterday' | 'week' | 'all'
)

# 处理消息
for msg in messages:
    print(f"[{msg['time']}] {msg['content']}")

wx.disconnect()
```

**返回格式**:
```python
{
    "type": "text",      # text / link / system
    "content": "消息内容",
    "time": "今天 15:30"
}
```

### 4. 群管理

#### 获取群成员列表
```python
wx = WeChatClient()
wx.connect()

members = wx.group_manager.get_group_members("工作群")
print(f"群成员数量:{len(members)}")
for member in members:
    print(member)

wx.disconnect()
```

#### 修改群昵称
```python
wx = WeChatClient()
wx.connect()

wx.group_manager.set_group_nickname("工作群", "张三的小号")

wx.disconnect()
```

#### 获取群昵称
```python
wx = WeChatClient()
wx.connect()

nickname = wx.group_manager.get_group_nickname("工作群")
print(f"我在本群的昵称:{nickname}")

wx.disconnect()
```

#### 设置消息免打扰
```python
wx = WeChatClient()
wx.connect()

# 开启免打扰
wx.group_manager.set_do_not_disturb("工作群", enable=True)

# 关闭免打扰
wx.group_manager.set_do_not_disturb("工作群", enable=False)

wx.disconnect()
```

#### 置顶/取消置顶聊天
```python
wx = WeChatClient()
wx.connect()

# 置顶聊天
wx.group_manager.set_pin_chat("工作群", enable=True)

# 取消置顶
wx.group_manager.set_pin_chat("工作群", enable=False)

wx.disconnect()
```

#### 修改群公告(如果修改不成功,很大概率是因为不是管理员的原因)
```python
wx = WeChatClient()
wx.connect()

# 优先使用这种方式,从 Markdown 文件设置公告(支持表格、列表等格式)
wx.group_manager.set_announcement_from_markdown("工作群", "markdown文件路径")

# 直接设置文本公告
wx.group_manager.modify_announcement_simple("工作群", "本群禁止发广告,违者移出")

wx.disconnect()
```

### 5. 群聊监听与 AI 自动回复

#### 监听多个群聊消息
```python
from wx4py import CallbackHandler, MessageEvent, WeChatClient

groups = ["工作群1", "工作群2", "工作群3"]

def on_message(event: MessageEvent):
    print(f"[{event.group}] {event.content}")
    return ""  # 只监听,不自动回复

with WeChatClient(auto_connect=True) as wx:
    wx.process_groups(
        groups,
        [CallbackHandler(on_message)],
        block=True,
    )
```

#### 只在被 @ 时自动回复
```python
from wx4py import AsyncCallbackHandler, MessageEvent, WeChatClient

groups = ["工作群1", "工作群2"]

def reply(event: MessageEvent):
    if not event.is_at_me:
        return ""
    return f"收到:{event.content}"

with WeChatClient(auto_connect=True) as wx:
    wx.process_groups(
        groups,
        [AsyncCallbackHandler(reply, auto_reply=True, reply_on_at=True)],
        block=True,
    )
```

#### 监听指定群消息并转发给指定联系人或群
```python
from wx4py import ForwardRuleHandler, GroupForwardRule, WeChatClient

rules = [
    GroupForwardRule(
        source_group="告警群",
        targets=["值班同学"],
        target_type="contact",
        prefix_template="[告警群] ",
    ),
    GroupForwardRule(
        source_group="项目群A",
        targets=["项目群B"],
        target_type="group",
        prefix_template="[项目群A] ",
    ),
]

with WeChatClient(auto_connect=True) as wx:
    wx.process_groups(
        ["告警群", "项目群A"],
        [ForwardRuleHandler(rules)],
        block=True,
    )
```

**适用场景**:
- 监听告警群,把消息转发给值班联系人
- 监听业务群,把消息同步到另一个群
- 针对不同来源群,配置不同的联系人或群作为目标

#### 使用内置 AIClient 接入 OpenAI 兼容接口
```python
import os
from wx4py import AIClient, AIConfig, AIResponder, AsyncCallbackHandler, WeChatClient

ai = AIClient(
    AIConfig(
        base_url="https://api.example.com/v1",
        api_format="completions",
        model="your-model-id",
        api_key=os.environ["AI_API_KEY"],
        enable_thinking=False,
    )
)

with WeChatClient(auto_connect=True) as wx:
    wx.process_groups(
        ["工作群"],
        [
            AsyncCallbackHandler(
                AIResponder(ai, context_size=8, reply_on_at=True),
                auto_reply=True,
            )
        ],
        block=True,
    )
```

#### 使用自定义 AI 或业务系统
```python
from wx4py import AsyncCallbackHandler, MessageEvent, WeChatClient

def custom_reply(event: MessageEvent):
    if not event.is_at_me:
        return ""

    # 这里可以调用公司内部接口、其他 AI SDK 或业务系统。
    return f"自定义回复:{event.content}"

with WeChatClient(auto_connect=True) as wx:
    wx.process_groups(
        ["工作群"],
        [AsyncCallbackHandler(custom_reply, auto_reply=True, reply_on_at=True)],
        block=True,
    )
```

**实现说明**:
- 每个群优先打开独立聊天窗口,适合同时监听多个群。
- 自动回复通过发送队列串行执行,避免多个群同时回复时抢占窗口。
- 本库发送的消息会自动记录,避免机器人监听到自己的回复后再次触发。

## 使用模式

### 推荐:使用上下文管理器
```python
from wx4py import WeChatClient

with WeChatClient() as wx:
    # 自动连接和断开
    wx.chat_window.send_to("文件传输助手", "Hello!")
```

### 手动连接管理
```python
wx = WeChatClient()
wx.connect()

try:
    # 执行操作
    wx.chat_window.send_to("文件传输助手", "Hello!")
finally:
    wx.disconnect()
```

## 实用脚本示例

### 示例1:定时群发通知
```python
from wx4py import WeChatClient
import schedule
import time

def send_daily_notification():
    with WeChatClient() as wx:
        groups = ["工作群1", "工作群2", "工作群3"]
        message = "早安!今日工作提醒..."
        wx.chat_window.batch_send(groups, message, target_type='group')
        print("通知已发送")

# 每天早上9点发送
schedule.every().day.at("09:00").do(send_daily_notification)

while True:
    schedule.run_pending()
    time.sleep(60)
```

### 示例2:收集昨天的聊天记录并保存
```python
from wx4py import WeChatClient
import json
from datetime import datetime

with WeChatClient() as wx:
    # 获取昨天的聊天记录
    messages = wx.chat_window.get_chat_history(
        target="工作群",
        target_type='group',
        since='yesterday'
    )

    # 保存到文件
    filename = f"chat_history_{datetime.now().strftime('%Y%m%d')}.json"
    with open(filename, 'w', encoding='utf-8') as f:
        json.dump(messages, f, ensure_ascii=False, indent=2)

    

Diskussion

Fragen, Tipps teilen oder melden, dass etwas nicht geht. Sortiert nach „hilfreich“.

Noch keine Beiträge. Stell die erste Frage oder teile einen Tipp.

Beiträge hier stammen von Nutzern, nicht vom PopNx-Team.

Anmelden, um zu posten

Von GitHub

GitHub-Sterne
807
Anbieter
claw-codes
Lizenz
AGPL-3.0
Letzte Codeänderung
11. Apr. 2026
SKILL.md-Dateien im Repo (mit Übersetzungen und Vorlagen)
1
Themen
automation, openclaw-skills, python, rpa, skills, wechat, weixin