1 Star 4 Fork 1

刘凯/wechat_pc_api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
GPL-3.0

介绍

wechat_pc_api 使用HOOK技术将核心功能封装成dll,并提供简易的接口给程序调用。

你可以通过扩展 wechat_pc_api 来实现:

  • 监控或收集微信消息
  • 自动消息推送
  • 聊天机器人
  • 通过微信远程控制你的设备

测试可以使用语言有C/C++,C#,易语言,Python, Java, Go, NodeJs, PHP, VB, Delphi。

目前支持的微信PC版本是3.0.0.57, 使用api前,先这里下载并安装WeChatSetup_3.0.0.57.exe 提取码:o6uj

功能清单

  • 任意多开
  • 支持已经在运行微信进程
  • 支持接收所有类型的消息(包括接口发送,pc电脑上直接发送的)
  • 支持获取群,群成员,好友列表,公众号列表
  • 支持常见消息类型的发送
  • 支持emoji

文档

具体使用可以暂时参考samples/python/demo.py, 如下是python封装后的调用

from __future__ import unicode_literals

import wechat
import json
import time
from wechat import WeChatManager, MessageType

wechat_manager = WeChatManager(libs_path='../../libs')


# 这里测试函数回调
@wechat.CONNECT_CALLBACK(in_class=False)
def on_connect(client_id):
    print('[on_connect] client_id: {0}'.format(client_id))


@wechat.RECV_CALLBACK(in_class=False)
def on_recv(client_id, message_type, message_data):
    print('[on_recv] client_id: {0}, message_type: {1}, message:{2}'.format(client_id,
                                                                            message_type, json.dumps(message_data)))


@wechat.CLOSE_CALLBACK(in_class=False)
def on_close(client_id):
    print('[on_close] client_id: {0}'.format(client_id))


# 这里测试类回调, 函数回调与类回调可以混合使用
class LoginTipBot(wechat.CallbackHandler):

    @wechat.RECV_CALLBACK(in_class=True)
    def on_message(self, client_id, message_type, message_data):
        # 判断登录成功后,就向文件助手发条消息
        if message_type == MessageType.MT_USER_LOGIN:
            time.sleep(2)
            wechat_manager.send_text(client_id, 'filehelper', '😂😂😂\uE052该消息通过wechat_pc_api项目接口发送')
            
            wechat_manager.send_link(client_id, 
            'filehelper', 
            'wechat_pc_api项目', 
            'WeChatPc机器人项目', 
            'https://github.com/smallevilbeast/wechat_pc_api', 
            'https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/0203e82433363e5ff9c6aa88aa9f1bbe?showdoc=.jpg)')


if __name__ == "__main__":
    bot = LoginTipBot()

    # 添加回调实例对象
    wechat_manager.add_callback_handler(bot)
    wechat_manager.manager_wechat(smart=True)

    # 阻塞主线程
    while True:
        time.sleep(0.5)

帮助&支持

点击链接加入群聊WeChatApi交流群: 308918346

空文件

简介

微信机器人,微信HOOK, 微信PC版hook 展开 收起
README
GPL-3.0
取消

发行版

暂无发行版

贡献者 (1)

全部

近期动态

3年多前创建了仓库
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liusukai/wechat_pc_api.git
git@gitee.com:liusukai/wechat_pc_api.git
liusukai
wechat_pc_api
wechat_pc_api
master

搜索帮助