Giter Site home page Giter Site logo

llyyayx / wechatpcapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kylelkh/wechatpcapi

0.0 0.0 0.0 132.51 MB

微信PC版的API接口,可通过Python调用微信获取好友、群、公众号列表,并收发消息等功能。

License: GNU General Public License v3.0

Python 100.00%

wechatpcapi's Introduction

WechatPCAPI

微信PC版的API接口,可通过Python调用微信获取好友、群、公众号列表,并收发消息等功能。可用于二次开发在线微信机器人、微信消息监控、群控软件、开发界面作多个微信控制软件等用途。

当前版本:@钊@

当前版本是免费版本

另有更稳定、更可靠、更强大的付费版本,点这里了解。付费版本README

如果帮到你,帮我点个star。 遇到问题可以提Issues,或关注公众号“燕幕自安”联系我。

延伸项目

有一些小伙伴在这个项目基础上做了其他功能,我列在下面供大家参考借鉴:

https://github.com/elliot-bia/msg_reply

https://github.com/mortimer-cra/AlarmRobot (微信提醒喵)

版本功能区别

看不到图的话,代码目录也有,可以下载查看或进Q群查看。

怎么用?

  1. clone/下载源码到本地
  2. 安装源码包里的微信客户端(你以前的版本和这个不一致的都需要安装这个)
  3. 执行源码中的test.py

目前提供pyd和依赖的相关文件,通过python直接import即可使用,目录里的test.py即是调用示例。

环境支持情况

windows 7/10 测试通过

python 3.7.4 不是该版本可能会报错dll load 错误

微信版本 目前仅支持V2.7.1.82版本,后续会考虑兼容其他版本,目录包里有该微信版本,直接下载安装即可。

国内下载慢?

现在不支持百度网盘更新了,请进群获取最新版本代码和相关文件,有问题也可以在群里咨询讨论。

QQ群:579737590(广告实在太多了,加了1元付费入群)

QQ群

遇到问题?

  1. 请保证微信版本是从我的包里装的。
  2. 出现“找不到指定模块”,请安装python3.7运行,还不行的话,大致是因为windows相关运行库的缺失,请自行打开windows更新,或安装各个版本的运行时库。
  3. 其他问题和接口问题请在Issues中提问。

函数文档注释

不知道怎么调用的话,可以使用help(类名)查看函数文档,如下:

Help on class WechatPCAPI in module WechatPCAPI:

class WechatPCAPI(builtins.object)
 |  WechatPCAPI(on_message=None, on_wx_exit_handle=None, log=None)
 |
 |  微信PC版的API接口--当前版本:@钊@
 |
 |  Methods defined here:
 |
 |  __init__(self, on_message=None, on_wx_exit_handle=None, log=None)
 |      类初始化函数
 |      :param on_message: 收到微信消息时的回调函数
 |      :param on_wx_exit_handle: 微信退出的回调函数,可空
 |      :param log: 日志句柄
 |
 |  get_myself(self)
 |      获取我的信息,即所登录账号的信息
 |      :return: 尚未登陆成功时为None, 登陆成功后为dict格式返回
 |
 |  send_card(self, to_user, wx_id)
 |      发送名片
 |      :param to_user: 发给谁(wx_id)
 |      :param wx_id: 要发送谁的名片(wx_id)
 |      :return: 无
 |
 |  send_file(self, to_user, file_abspath)
 |      发送文件
 |      :param to_user: 发给谁(wx_id)
 |      :param file_abspath: 文件在本地的绝对路径
 |      :return: 无
 |
 |  send_gif(self, to_user, gif_abspath)
 |      发送gif表情
 |      :param to_user: 发给谁(wx_id)
 |      :param gif_abspath: gif在本地的绝对路径
 |      :return: 无
 |
 |  send_img(self, to_user, img_abspath)
 |      发送图片
 |      :param to_user: 发给谁(wx_id)
 |      :param img_abspath: 图片在本地的绝对路径
 |      :return: 无
 |
 |  send_link_card(self, to_user, title, desc, target_url, img_url='')
 |      发送链接分享
 |      :param to_user: 发给谁(wx_id)
 |      :param title: 链接标题
 |      :param desc: 链接描述
 |      :param target_url: 链接URL
 |      :param img_url: 显示图片的URL
 |      :return: 无
 |
 |  send_text(self, to_user, msg)
 |      发送文本消息
 |      :param to_user: 发给谁(wx_id)
 |      :param msg: 文本消息内容
 |      :return: 无
 |
 |  start_wechat(self, block=True)
 |      启动微信,目前仅支持微信版本v2.7.1.82
 |      :param block: 是否阻塞,默认阻塞
 |      :return: 无
 |
 |  update_frinds(self)
 |      :return: 无
 |
 |  ----------------------------------------------------------------------

联系我

关注微信公众号“燕幕自安”,即可获取我的联系方式。

赞赏我

支持作者继续更新,请我喝杯咖啡

声明

本项目仅供技术研究,请勿用于非法用途,如有任何人凭此做何非法事情,均于作者无关,特此声明。

wechatpcapi's People

Contributors

mocha-l avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.