Turn a spare WeChat account into an AI assistant that answers questions from friends or customers automatically.
Add an AI bot to a WeChat group that only responds when someone at-mentions it.
Automate WeChat customer support replies for a small business using ChatGPT.
Requires an OpenAI API key and a reverse proxy server accessible from outside mainland China.
ChatGPT-wechat-bot is a TypeScript project that connects a WeChat account to the ChatGPT API, turning the account into an automated chat assistant. Once running, anyone who sends a message to the WeChat account can receive replies generated by ChatGPT. The bot also works inside WeChat group chats, where it responds when someone mentions it with an at-sign. The setup requires an OpenAI API key, which you obtain by creating an account on the OpenAI platform. Because ChatGPT's API is not directly accessible from mainland China, the project also requires a reverse proxy URL, which is a server outside China that forwards requests to OpenAI. You paste your API key and proxy address into a configuration file, then start the program with a couple of npm commands. A QR code appears in the terminal, you scan it with your phone using WeChat, and the bot goes live on that account. The bot keeps track of conversation context within a session, so follow-up questions work naturally. You can send a keyword such as "reset" to clear the context and start a fresh conversation. In group chats, you can configure a keyword that must be included before the bot replies, so it does not respond to every message in the group. The configuration file has a handful of options: the API key, the proxy URL, the keyword that triggers the bot in group chats, a separate keyword for private chats, the reset keyword, and toggles that control whether the bot echoes the original question back in its reply. The project requires Node.js version 16.8 or higher. The README is written mostly in Chinese, with a brief English introduction at the top. Common issues covered include what to do if WeChat sign-in gets stuck, how to handle truncated replies from ChatGPT, and how to fix a browser launch error related to the library used to drive the WeChat web interface.
← autumnwhj on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.