adoin / wechat-chatgpt

Use ChatGPT On Wechat via wechaty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to wechat-chatgpt 👋

Version License: ISC Twitter: fuergaosi

Use ChatGPT On Wechat via wechaty
English | 中文文档

Update Decomber 27, 2022

Using railway & docker deployment, there may be problems that cannot be solved, we are working on it.

Update December 20, 2022

Thanks @transitive-bullshit, The ChatGPT API automates the work.
You should use password & username to login, and config CAPTCHAs.
⚠️ There may be a problem with the Docker image because I don't have an X86 device and Qume doesn't work.

🌟 Feature

  • Use ChatGPT On Wechat via wechaty
  • Support OpenAI Accounts Pool
  • Support use proxy to login
  • Add conversation Support
  • Add Dockerfile
  • Publish to Docker.hub
  • Add Railway deploy
  • Auto Reload OpenAI Accounts Pool
  • Add sendmessage retry for 429/503

Install

npm install && poetry install

NodeJS Version >= 18.0.0 Python Version >= 3.9.0

Config

Copy config

You need copy config file for setting up your project.

cp config.yaml.example config.yaml

Get and config Openai account

If you don't have this OpenAI account and you live in China, you can get it here.

Use account and password

You need get OpenAI account and password. Your config.yaml should be like this:

chatGPTAccountPool:
  - email: <your email>
    password: <your password>
# if you hope only some keywords can trigger chatgpt on private chat, you can set it like this:
chatPrivateTiggerKeyword: ""

⚠️ Trigger keywords must appear in the first position of the received message. ⚠️ Pls make sure your network can log in to OpenAI, and if you fail to login in try setting up a proxy or using SessionToken.

Setup proxy:

You can configure in config.yaml:

openAIProxy: <Your Proxy>

CAPTCHAS

The browser portions of this package use Puppeteer to automate as much as possible, including solving all CAPTCHAs. 🔥

Basic Cloudflare CAPTCHAs are handled by default, but if you want to automate the email + password Recaptchas, you'll need to sign up for one of these paid providers:

  • nopecha - Uses AI to solve CAPTCHAS
    • Faster and cheaper
    • Set the NOPECHA_KEY env var to your nopecha API key
    • Demo video of nopecha solving the login Recaptcha (41 seconds)
  • 2captcha - Uses real people to solve CAPTCHAS
    • More well-known solution that's been around longer
    • Set the CAPTCHA_TOKEN env var to your 2captcha API token

So you should config NOPECHA_KEY or CAPTCHA_TOKEN in your Environment Variables.

Start Project

npm run dev

If you are logging in for the first time, then you need to scan the qrcode.

👤 holegots

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

About

Use ChatGPT On Wechat via wechaty


Languages

Language:TypeScript 94.7%Language:Dockerfile 4.5%Language:Shell 0.8%