Skip to main content

wechat robot framework.

Project description

pywx

release License

介绍

  • 基于pc微信hook的api接口

支持的接口

  1. hook同步消息
  2. 取消hook同步消息
  3. hook日志
  4. 取消hook日志
  5. 检查登录状态
  6. 获取用户信息
  7. 发送文本消息
  8. 发送图片消息
  9. 发送文件消息
  10. 发送表情消息
  11. 发送小程序消息
  12. 发送群@消息
  13. 发送拍一拍消息
  14. 获取联系人列表
  15. 获取联系人详情
  16. 创建群聊
  17. 退出群聊
  18. 获取群详情
  19. 获取群成员列表
  20. 添加群成员
  21. 删除群成员
  22. 邀请群成员
  23. 修改群成员昵称
  24. 设置群置顶消息
  25. 移除群置顶消息
  26. 转发消息
  27. 获取朋友圈首页
  28. 获取朋友圈下一页
  29. 收藏消息
  30. 收藏图片
  31. 下载附件
  32. 转发公众号消息
  33. 转发公众号消息通过消息ID
  34. 解码图片
  35. 获取语音通过消息ID
  36. 图片文本识别
  37. 获取数据库句柄
  38. 执行SQL命令
  39. 测试

支持的微信版本下载

安装

pip install npywx

使用示例

# import os
# os.environ["PYWX_LOG_LEVEL"] = "INFO" # 修改日志输出级别
from pywx import Bot
from pywx import events
from pywx.utils import parse_event

# faked_version解除微信低版本登录限制
bot = Bot(faked_version="3.9.10.19")


@bot.handle(events.TEXT_MESSAGE)
def on_text_message(bot: Bot, event):
    message = parse_event(event)
    self_id = bot.get_self_info()["data"]["wxid"]
    if message["fromUser"] != self_id:
        bot.send_text(message["fromUser"], message["content"])


bot.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npywx-0.0.1.tar.gz (850.2 kB view details)

Uploaded Source

File details

Details for the file npywx-0.0.1.tar.gz.

File metadata

  • Download URL: npywx-0.0.1.tar.gz
  • Upload date:
  • Size: 850.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for npywx-0.0.1.tar.gz
Algorithm Hash digest
SHA256 638b2233d7fc6a4cb403729ef08c782b53cd2e05f93e6add3d3ad562128205ea
MD5 b58c512d965e9ef5594febdd01aef6d3
BLAKE2b-256 7efc4ae226910e80c48c8d328a121030124211b0a4970e1abc64f4a0747d9607

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page