Turn your WeChat into an auto-reply bot powered by ChatGPT!
This project is implemented based on this amazing project, but with a major adjustment: using the official OpenAI API Key
to replace the previous pesudo-browser method, so it has the following features:
- More stable and robust connection to
ChatGPT
- Can be deployed on cloud servers with no connection error (which the aforementioned project currently can't)
You can deploy in local or deploy on cloud, whatever you want.
Create a file config.yaml
, and paste the following configuration:
openaiApiKey: "<your_openai_api_key>"
openaiOrganizationID: "<your_organization_id>"
chatgptTriggerKeyword: "<your_keyword>"
Please note:
openaiApiKey
can be generated in the API Keys Page in your OpenAI accountopenaiOrganizationID
is optional, which can be found in the Settings Page in your Open AI accountchatgptTriggerKeyword
is the keyword which can trigger auto-reply:- In private chat, the message starts with it will trigger
- In group chat, the message starts with
@Name <keyword>
will trigger (Here@Name
mean do the"@" the bot in the group chat)
chatgptTriggerKeyword
is empty string means no keyword to trigger auto-reply
-
Setup Docker Image
docker build -t chatgpt-on-wechat .
-
Setup Docker Container
docker run -v $(pwd)/config.yaml:/app/config.yaml chatgpt-on-wechat
Click the button below to fork this repo and deploy with Railway!
Please note:
Make sure the environment variables are set in RailWay instead of writing directly in config.yaml
. It's really NOT recommended to implicitly write out your OpenAI API Key
in public. Anyone with your key can get access to the ChatGPT service, and it's possbile for you to lose money if you pay for the OpenAI ChatGPT service.
Once you deploy the bot successfully, just follow the Deploy Logs
or Console
prompt carefully:
- Scan the QR Code with mobile WeChat
- Click "Accpet" to allow desktop login (where our bot stays)
- Wait a few seconds and start chatting!
🤖 Enjoy your powerful chat bot! 🤖