Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Windows版本微信客户端(非网页版)自动化,可实现简单的发送、接收微信消息,简单微信机器人

License

NotificationsYou must be signed in to change notification settings

cluic/wxauto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plus

wxautoV2版本

文档使用文档 |云服务器wxauto部署指南

环境版本
OSWindows
微信Wechat
PythonPython

Star History Chart

使用示例

1. 基本使用

fromwxautoimportWeChat# 初始化微信实例wx=WeChat()# 发送消息wx.SendMsg("你好",who="张三")# 获取当前聊天窗口消息msgs=wx.GetAllMessage()formsginmsgs:print(f"消息内容:{msg.content}, 消息类型:{msg.type}")

2. 监听消息

fromwxautoimportWeChatfromwxauto.msgsimportFriendMessageimporttimewx=WeChat()# 消息处理函数defon_message(msg,chat):text=f'[{msg.type}{msg.attr}]{chat} -{msg.content}'print(text)withopen('msgs.txt','a',encoding='utf-8')asf:f.write(text+'\n')ifmsg.typein ('image','video'):print(msg.download())ifisinstance(msg,FriendMessage):time.sleep(len(msg.content))msg.quote('收到')    ...# 其他处理逻辑,配合Message类的各种方法,可以实现各种功能# 添加监听,监听到的消息用on_message函数进行处理wx.AddListenChat(nickname="张三",callback=on_message)# ... 程序运行一段时间后 ...# 移除监听wx.RemoveListenChat(nickname="张三")

交流

微信交流群

最后

如果对您有帮助,希望可以帮忙点个Star,如果您正在使用这个项目,可以将右上角的 Unwatch 点为 Watching,以便在我更新或修复某些 Bug 后即使收到反馈,感谢您的支持,非常感谢!

免责声明

代码仅用于对UIAutomation技术的交流学习使用,禁止用于实际生产项目,请勿用于非法用途和商业用途!如因此产生任何法律纠纷,均与作者无关!

About

Windows版本微信客户端(非网页版)自动化,可实现简单的发送、接收微信消息,简单微信机器人

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp