This bot supports two modes:
- wxauto: Controls the WeChat PC Client (Windows only).
- WeCom (企业微信): Uses the official Enterprise WeChat API (No client needed, runs as a server).
- Python 3.8+
- For wxauto mode: WeChat PC Client installed and logged in.
- For WeCom mode: An Enterprise WeChat account (free to register) and a way to expose your local port to the internet (e.g., ngrok).
-
Install dependencies:
pip install -r requirements.txt
-
Configure
config/config.yaml:- Set
modeto"wxauto"or"wecom". - Fill in the corresponding API keys and settings.
- Set
- Register at work.weixin.qq.com.
- Create a "Self-built App" (自建应用).
- Get
CorpID,Secret,AgentID. - Set
TokenandEncodingAESKeyin the app settings. - Important: You need a public URL for the callback.
- Use ngrok for local testing:
ngrok http 5000 - Set the "URL for Message Receiving" in WeCom to:
https://your-ngrok-url.ngrok-free.app/wechat
- Use ngrok for local testing:
Run the bot:
python main.py