Git Product home page Git Product logo

wxautoapi's Introduction

wxautoapi

测试版本V1.0.1

本次测试时长一个月,截至日期2022-09-30,有任何问题可提交Issues

测试结束后删除

环境 版本
OS Windows
微信 Wechat
Python Python

功能

发送文本消息、图片消息、文件消息、XML卡片,接收消息、保存聊天图片、文件,接受、发送好友请求,多开微信....详情可参考文档

安装

根据python版本,选用相应版本的whl包进行安装

pip install wxautoapi-1.0.1-cp37-cp37m-win_amd64.whl

开始使用

注意:该项目只支持Windows PC微信3.7.0.29版本,调用前请先检查版本!!!微信3.7.0.29下载

注意:该项目只支持Windows PC微信3.7.0.29版本,调用前请先检查版本!!!微信3.7.0.29下载

注意:该项目只支持Windows PC微信3.7.0.29版本,调用前请先检查版本!!!微信3.7.0.29下载

WeChatVersion

快速开始:

1. 调用实例

>>> from wxautoapi import WeChat

# 登录微信(已登录的微信请先退出)
>>> wx = WeChat()
成功启动微信1804等待登录...
微信已登录 (<wxid_xxxxxxxxxxxxx>, XXXX)>>>>>>>

# ======================= 注意! =======================

# 请确保微信已登录后,再运行下述步骤,否则无法正常调用相关方法!!!
# 请确保微信已登录后,再运行下述步骤,否则无法正常调用相关方法!!!
# 请确保微信已登录后,再运行下述步骤,否则无法正常调用相关方法!!!

# ======================= 注意! =======================

# 文件传输助手
>>> wx.filehelper.send_text('你好!')
>>> wx.filehelper.send_file('D:/test.txt')

# 查找好友
# 方法一(不知道wxid):查找备注为张三的好友
>>> person = wx.find_person(by='remark', value='张三')
>>> person.send_text('你好~')
# 方法二(知道wxid):
>>> person = wx['wxid_xxxxxxxx']

# 查找群(查找备注为工作1群的微信群)
>>> group = wx.find_group(by='remark', value='工作1群')
>>> group.send_text('大家好')

# 获取消息
>>> Messages = wx.getmsgs()
>>> Messages  # 返回一个消息列表,包含所有消息对象
[<WeChat TextMessage Element at 0x2a2781e16a0>,
 <WeChat ImageMessage Element at 0x2a276d7dc18>,
 <WeChat Other Message Element at 0x2a276d7dba8>,
 <WeChat TextMessage Element at 0x2a276d7dc50>,
 <WeChat TextMessage Element at 0x2a276d7d908>]
>>> msg = Messages[0]
>>> msg.text # 消息内容
"xxxxx"

2. 多开实例

>>> from wxautoapi import WeChat

>>> n = 3  # 多开数量,例如同时开启3个微信
>>> wxdict = {f'wx{i}':WeChat() for i in range(n)}  # 
>>> wxdict
{'wx0': <WeChat Object at 0x2a275e15f28 - (未登录)>,
 'wx1': <WeChat Object at 0x2a276804320 - (未登录)>,
 'wx2': <WeChat Object at 0x2a27681cbe0 - (未登录)>}
# 登录微信之后,所有操作与调用实例一样
>>> wxdict['wx0'].filehelper.send_text('123') # 操作第一个微信向文件传输助手发送消息:123

MultiApp

声明

1. 本项目仅供学习研究,不可用于违法犯罪活动,因本项目造成的任何后果与作者无关

2. 本项目完全独立,跟作者无任何信息交互,不存在任何盗取数据的行为,如若发现可报警处理

wxautoapi's People

Contributors

cluic 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.