Build a chatbot that automatically responds to specific WeChat messages based on keyword rules, without touching the app manually.
Forward log output or error alerts from Python scripts directly to yourself on WeChat for monitoring.
Automate group chat management by creating groups, inviting contacts, and forwarding messages between accounts.
WeChat web login required, bot accounts risk being blocked from the WeChat web client, strongly recommended to use a spare secondary account.
wxpy is a Python library for automating a WeChat personal account. WeChat is the dominant messaging platform in China, and this library provides a Python interface to its web-based login, letting you write scripts that send and receive messages programmatically without touching the app manually. With a few lines of code you can log into WeChat by scanning a QR code, search your contacts by name or attributes like gender and city, send text messages or image and video files to friends or groups, and set up handlers that automatically respond when certain messages arrive. The library also supports creating group chats, inviting contacts into groups, forwarding messages across accounts or groups, and automatically accepting friend requests. The README describes common use cases including sending log output from other programs directly to your WeChat, building chatbots that hold conversations, controlling smart home devices that have open APIs, and pranking friends. The library is built on top of an earlier project called itchat and adds a cleaner object-oriented interface with multi-threaded message handling for faster responses. The project's README includes a notable warning: using a bot carries some risk that the account may be blocked from logging into the WeChat web client, though it does not affect the mobile app. The authors strongly recommend running bots on a secondary spare account rather than a primary one. The library supports Python 2.7 and Python 3.4 through 3.6 and can be installed via pip.
← youfou on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.