前置条件:
- 安装微信3.6.0.18版本。
> pip install wxchat
启动微信服务端程序
> weixin_server.exe --port1 10086 --port2 10010
编写python代码,接受微信的消息
from wechat import WechatHelper
helper = WechatHelper(127.0.0.1, 10086, 10010)
helper.wait_until_login()
helper.send_text("filehelper", "你好!")
@helper.message("chat")
def receive_message(topic, message):
print(message)
helper.run_forever()
TODO
- 接收消息
- 发送消息
- 查询好友
- 添加好友
- 获取群成员
- 获取通讯录
- 发送卡片
- 发送文章
- 自动收款
- 自动入群
- 自动同意好友请求
- 发送小程序
本项目仅为学习交流之用,如有问题请添加微信haiyiqiang