Giter VIP home page Giter VIP logo

chatgpt-on-wechat's Introduction

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 .
  1. 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! ๐Ÿค–

chatgpt-on-wechat's People

Contributors

dependabot[bot] avatar kx-huang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.