Skip to content

🤖️ Deploy your WeChat AI chatbot within 2 steps! 两步部署你的微信人工智能聊天机器人!🤖️

Notifications You must be signed in to change notification settings

sxie2004/ChatGPT-on-WeChat

Repository files navigation

ChatGPT on WeChat! License: ISC wakatime

Turn your WeChat into an auto-reply bot powered by ChatGPT!

Your Chat Bot in Group Chat!

0. Acknowledgement && Features

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)

1. How to Deploy this Bot?

You can deploy in local or deploy on cloud, whatever you want.

1.1 Deploy in Local

1.1.1 Configure Environment Variables

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 account
  • openaiOrganizationID is optional, which can be found in the Settings Page in your Open AI account
  • chatgptTriggerKeyword 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

1.1.2 Setup the Docker

  1. Setup Docker Image

    docker build -t chatgpt-on-wechat .
  2. Setup Docker Container

    docker run -v $(pwd)/config.yaml:/app/config.yaml chatgpt-on-wechat

1.2 Deploy on Cloud

Click the button below to fork this repo and deploy with Railway!

Deploy on 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.


2. How to Link to your WeChat?

Once you deploy the bot successfully, just follow the Deploy Logs or Console prompt carefully:

  1. Scan the QR Code with mobile WeChat
  2. Click "Accpet" to allow desktop login (where our bot stays)
  3. Wait a few seconds and start chatting!

🤖 Enjoy your powerful chat bot! 🤖

About

🤖️ Deploy your WeChat AI chatbot within 2 steps! 两步部署你的微信人工智能聊天机器人!🤖️

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.7%
  • Dockerfile 4.2%
  • Shell 1.1%