Skip to main content

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()

Metadata

Release files for npywx 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npywx 0.0.1
File Size Uploaded
npywx-0.0.1.tar.gz 850.2 kB Details

Release files / npywx-0.0.1.tar.gz

Download URL npywx-0.0.1.tar.gz
Size 850.2 kB
Tags Source
SHA-256 checksum
How to use checksums
638b2233d7fc6a4cb403729ef08c782b53cd2e05f93e6add3d3ad562128205ea
BLAKE2b-256 checksum
How to use checksums
7efc4ae226910e80c48c8d328a121030124211b0a4970e1abc64f4a0747d9607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page