{"id":13366907,"url":"https://github.com/lich0821/WeChatFerry","last_synced_at":"2025-03-12T18:31:39.514Z","repository":{"id":60047665,"uuid":"538979582","full_name":"lich0821/WeChatFerry","owner":"lich0821","description":"微信机器人底层框架，可接入Gemini、ChatGPT、ChatGLM、讯飞星火、Tigerbot等大模型。WeChat Robot Hook.","archived":false,"fork":false,"pushed_at":"2024-10-17T07:54:46.000Z","size":16338,"stargazers_count":4037,"open_issues_count":31,"forks_count":714,"subscribers_count":57,"default_branch":"master","last_synced_at":"2024-10-19T10:32:42.679Z","etag":null,"topics":["chatglm","chatgpt","gemini","hook","robot","wechat"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lich0821.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-20T12:33:37.000Z","updated_at":"2024-10-19T04:03:56.000Z","dependencies_parsed_at":"2024-05-04T11:30:35.084Z","dependency_job_id":"570cb204-222f-49e3-bb38-968063e4dd88","html_url":"https://github.com/lich0821/WeChatFerry","commit_stats":{"total_commits":631,"total_committers":14,"mean_commits":45.07142857142857,"dds":0.07765451664025358,"last_synced_commit":"bf8e6bddb90cbb9aa6a34efcc47d2a2b9e85f8d7"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FWeChatFerry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FWeChatFerry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FWeChatFerry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FWeChatFerry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lich0821","download_url":"https://codeload.github.com/lich0821/WeChatFerry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220547439,"owners_count":16665873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatglm","chatgpt","gemini","hook","robot","wechat"],"created_at":"2024-07-30T00:01:33.952Z","updated_at":"2025-03-12T18:31:39.502Z","avatar_url":"https://github.com/lich0821.png","language":"C++","funding_links":[],"categories":["miscellaneous","网络信息服务","C++","Others","AI应用"],"sub_categories":["信息沟通"],"readme":"# WeChatFerry\r\n\r\n一个玩微信的工具。更多介绍见：[WeChatFerry: 一个玩微信的工具](https://mp.weixin.qq.com/s/CGLfSaNDy8MyuyPWGjGJ7w)。\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cb\u003e⚠️ 免责声明【必读】⚠️\u003c/b\u003e\u003c/summary\u003e\r\n\r\n请阅读完整的免责声明：[点击查看](WeChatFerry/DISCLAIMER.md)\r\n\r\n\u003c/details\u003e\r\n\r\n|[📖 Python 文档](https://wechatferry.readthedocs.io/)|[📺 Python 视频教程](https://mp.weixin.qq.com/s/APdjGyZ2hllXxyG_sNCfXQ)|[🙋 FAQ](https://mp.weixin.qq.com/s/UbzPuw3-2xZLEzUABXMEdw)|\r\n|:-:|:-:|:-:|\r\n\r\n👉 [WeChatRobot🤖](https://github.com/lich0821/WeChatRobot)，一个基于 WeChatFerry 的 Python 机器人示例。\r\n\r\n|![碲矿](assets/TEQuant.jpg)|![赞赏](assets/QR.jpeg)|\r\n|:-:|:-:|\r\n|后台回复 `WCF` 加群交流|如果你觉得有用|\r\n\r\n\u003cdetails\u003e\u003csummary\u003e点击查看功能清单\u003c/summary\u003e\r\n\r\n* 获取登录二维码\r\n* 查询登录状态\r\n* 获取登录账号信息\r\n* 获取消息类型\r\n* 获取联系人\r\n* 获取可查询数据库\r\n* 获取数据库所有表\r\n* 获取语音消息\r\n* 发送文本消息（可 @）\r\n* 发送图片消息\r\n* 发送文件消息\r\n* 发送卡片消息\r\n* 发送 GIF 消息\r\n* 拍一拍群友\r\n* 转发消息\r\n* 开启接收消息\r\n* 关闭接收消息\r\n* 查询数据库\r\n* 获取朋友圈消息\r\n* 下载图片、视频、文件\r\n* 解密图片\r\n* 添加群成员\r\n* 删除群成员\r\n* 邀请群成员\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\u003csummary\u003e点击查看支持的客户端\u003c/summary\u003e\r\n\r\n* Python\r\n* HTTP\r\n* NodeJS\r\n\r\n\u003c/details\u003e\r\n\r\n## 感谢大佬们贡献代码\r\n\r\n\u003ca href=\"https://github.com/lich0821/WeChatFerry/graphs/contributors\"\u003e![](https://contrib.rocks/image?repo=lich0821/WeChatFerry\u0026columns=8)\u003c/a\u003e\r\n\r\n## 快速开始\r\n### Python\r\n[![PyPi](https://img.shields.io/pypi/v/wcferry.svg)](https://pypi.python.org/pypi/wcferry) [![Downloads](https://static.pepy.tech/badge/wcferry)](https://pypi.python.org/pypi/wcferry) [![Documentation Status](https://readthedocs.org/projects/wechatferry/badge/?version=latest)](https://wechatferry.readthedocs.io/zh/latest/?badge=latest)\r\n\r\n* 安装\r\n```sh\r\npip install --upgrade wcferry\r\n```\r\n\r\n* 参考示例：[🤖WeChatRobot](https://github.com/lich0821/WeChatRobot)\r\n\r\n### HTTP\r\n* [wcfrust](https://github.com/lich0821/wcf-client-rust)（基于 Rust）\r\n* [go_wcf_http](clients/go_wcf_http/README.MD)（基于 Go）\r\n* [wrest-chat](https://github.com/opentdp/wrest-chat)（基于 Go）\r\n* [wcf-http](https://github.com/yuxiaoli/wcf-http)（基于 Python）\r\n\r\n### Java\r\n* [java](clients/java/wcferry/README.MD)\r\n\r\n### NodeJS\r\n* [wcferry-node](https://github.com/dr-forget/wcferry-node)\r\n* [node-wcferry](https://github.com/stkevintan/node-wcferry)\r\n* [wechatferry](https://github.com/wechatferry/wechatferry)\r\n\r\n### C#\r\n* [WeChatFerry-CSharp](https://github.com/send010/WeChatFerry-CSharp)\r\n\r\n### Rust\r\n* [wechat-bot](https://github.com/CliffHan/wechat-bot)\r\n\r\n### Docker\r\n* [docker_wechat](https://github.com/Saroth/docker_wechat)\r\n* [wechatbot-provider-windows](https://github.com/danni-cool/wechatbot-provider-windows)\r\n\r\n## 一起开发\r\n\r\n\u003e 🚫 非开发用户不需要往下看。\r\n\u003e\r\n\u003e **开发用户**：可以根据文档和错误提示，自行解决编译错误的人员。\r\n\r\n### 安装开发环境\r\n\r\n\u003cdetails\u003e\u003csummary\u003e点击查看\u003c/summary\u003e\r\n\r\n#### 安装 vcpkg\r\n\r\n* 安装，参考[Vcpkg: 总览](https://github.com/microsoft/vcpkg/blob/master/README_zh_CN.md)。\r\n\r\n```sh\r\ncd C:\\Tools\r\ngit clone https://github.com/microsoft/vcpkg\r\n.\\vcpkg\\bootstrap-vcpkg.bat\r\n```\r\n\r\n* 添加全局配置：\r\n环境变量增加 `vcpkg` 所在路径（本文为：`C:\\Tools\\vcpkg`）：\r\n```sh\r\nsetx VCPKG_ROOT \"C:/Tools/vcpkg\" /M\r\n```\r\n\r\n* 与 Visual Studio 集成\r\n```sh\r\nvcpkg integrate install # 失败则说明未正确安装或者未正确配置环境变量\r\n```\r\n\r\n#### 安装相关组件\r\n\r\n编译时会自动安装。但如果需要使用 `protoc.exe`，则需要配置一下 `protoc.exe` 环境变量：`\u003cvcpkg_package_installed_path\u003e\\x64-windows-static\\x64-windows-static\\tools\\protobuf`。\r\n\r\n（本文为：`C:\\Projs\\WeChatFerry\\WeChatFerry\\vcpkg_installed\\x64-windows-static\\x64-windows-static\\tools\\protobuf`）\r\n\r\n#### 安装 VS2019\r\n\r\n#### 安装 Python3\r\n\r\n通过微软商店或者 python.org 自行下载均可（注意 `python` 版本不能太高，否则需要自行编译依赖，建议使用 python 3.10），然后配置好环境变量，确保 `python` 在命令行下可用。\r\n\r\n安装依赖：\r\n```sh\r\npip install grpcio-tools==1.48.2\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n### 编译\r\n\r\n使用 VS2019 打开工程，编译即可。编译成功后，在 `WeChatFerry\\WeChatFerry\\Out` 目录中会看到相应的 DLL 文件。\r\n\r\n**注**：如果遇到执行 `protoc` 时的 9009 错误，检查是否是 python3 环境有问题，或者 protoc 命令的环境变量配置不正确。\r\n\r\n### 运行\r\n```py\r\nimport ctypes\r\n# 加载 sdk.dll （需要绝对路径）\r\nsdk = ctypes.cdll.LoadLibrary(\"C:/Projs/WeChatFerry/WeChatFerry/Out/sdk.dll\")\r\n\r\n# 初始化\r\nsdk.WxInitSDK(False, 10086)\r\n\r\n# 退出 SDK\r\nsdk.WxDestroySDK()\r\n\r\n# 注意关闭 Python 进程\r\n```\r\n\r\n### 调试日志\r\n```c\r\n    util::dbg_msg(\"ListenMessage\"); // 封装的 OutputDebugString\r\n    OutputDebugString(L\"ListenMessage\\n\");\r\n    MessageBox(NULL, L\"ListenMessage\", L\"ListenMessage\", 0);\r\n```\r\n\r\n## 项目结构\r\n\r\n```sh\r\nWeChatFerry\r\n├── LICENSE                 # LICENSE\r\n├── README.MD               # 说明\r\n├── WeChatFerry\r\n│   ├── WeChatFerry.sln     # VS2019 工程文件\r\n│   ├── com                 # 公共模块\r\n│   ├── rpc                 # RPC 模块\r\n│   ├── sdk                 # 注入及启动模块\r\n│   ├── smc                 # Silk-Mp3 转换模块\r\n│   └── spy                 # 核心功能实现模块\r\n├── assets\r\n│   ├── QR.jpeg             # 二维码，测试用图\r\n│   ├── TEQuant.jpg         # 二维码，测试用图\r\n│   └── demo.gif            # 示例动图\r\n├── clients\r\n│   ├── go                  # Go 客户端\r\n│   ├── gohttp              # HTTP 客户端\r\n│   ├── http                # HTTP 客户端\r\n│   ├── java                # Java 客户端\r\n│   ├── node                # Node.js 客户端\r\n│   ├── pyauto              # 群友封装的客户端\r\n│   ├── python              # Python 客户端\r\n│   └── rust                # Rust 客户端\r\n└── docs                    # 文档\r\n\r\n```\r\n\r\n## 版本更新\r\n\r\n### v39.4.2\r\n\r\n* 修复附件下载类型错误。\r\n\r\n\u003cdetails\u003e\u003csummary\u003e点击查看更多\u003c/summary\u003e\r\n\r\n客户端越来越多了，版本号开始混乱，所以重新定义了版本号：`w.x.y.z`。\r\n\r\n其中：\r\n* `w` 是微信的大版本号，如 `37` (3.7.a.a), `38` (3.8.a.a), `39` (3.9.a.a)\r\n* `x` 是适配的微信的小版本号，从 0 开始\r\n* `y` 是 `WeChatFerry` 的版本，从 0 开始\r\n* `z` 是各客户端的版本，从 0 开始\r\n\r\n### v39.4.1\r\n\r\n* 修复乱码问题。\r\n\r\n### v39.4.0\r\n\r\n* 重构代码，适配 `3.9.12.17`。\r\n\r\n### v39.3.5\r\n\r\n* 代码优化\r\n\r\n### v39.3.4\r\n\r\n* 实现获取登录二维码\r\n\r\n### v39.3.3\r\n\r\n* 修复发送文件 / 图片中文路径问题\r\n\r\n### v39.3.2\r\n\r\n* 修复接收消息问题\r\n\r\n### v39.3.0\r\n\r\n* 适配 `3.9.11.25`\r\n\r\n### v39.2.4\r\n\r\n* 修复 wxid 问题\r\n\r\n### v39.2.3\r\n\r\n* 实现发送 GIF\r\n\r\n### v39.2.2\r\n\r\n* 修复开启、停止接收消息失败问题\r\n\r\n### v39.2.1\r\n\r\n* 实现了好多功能（见功能清单）\r\n\r\n### v39.2.0\r\n\r\n* 开始适配 `3.9.10.27`\r\n* 实现检查登录状态\r\n* 实现获取登录账号信息（wxid、昵称、手机号、数据目录）\r\n* 实现获取消息类型\r\n* 实现开启接收消息\r\n* 实现停止接收消息\r\n* 实现发送文本消息（可 @）\r\n* 实现发送图片消息\r\n\r\n### v39.1.0 (2024.04.19)\r\n\r\n* 适配 x64 环境\r\n* 重构项目\r\n* 开始适配 `3.9.10.19`\r\n\r\n\u003c/details\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flich0821%2FWeChatFerry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flich0821%2FWeChatFerry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flich0821%2FWeChatFerry/lists"}