OpenAI ChatGPT connects to WeChat and interacts with AI!

Original link:

The latest hot topic, ChatGPT launched by OpenAI is definitely on the list! But let’s not talk about the difficulty of registration, just say that every time you need some force majeure to access and use it, it is very troublesome. Most people can’t experience it. The method introduced in this article directly connects to personal WeChat (not official account) is very common! Basically, you can build it yourself if you have a computer, and there is a free experience at the end of the article.


What is ChatGPT?

ChatGPT is an open source chatbot framework, which uses OpenAI’s GPT-3 language model, which can realize functions such as natural language processing, question answering and dialogue generation. In layman’s terms, it is an AI chat robot.

It can answer a large number of questions while mimicking human speaking styles


It helps programmers to write a piece of code


can also help you calculate


In short, it can answer many questions


Register ChatGPT strategy

There are many articles on the Internet, so I won’t repeat them here. What needs to be paid attention to is the network and foreign mobile phone numbers.

You can refer to the article: OpenAI launches Super God ChatGPT registration strategy is here

Access personal WeChat


  • OpenAI account (the premise is that the account has a credit line, usually $18, and you can get it when you register)
  • WeChat account (small account is recommended)
  • API key

Obtain API Key Tutorial (The configuration file needs to fill in the API Key)

  1. Log in to OpenAI – avatar in the upper right corner – View API keys


  2. Click Create new secret key


  3. After the API Key is successfully created, copy and bookmark this Key, which will be used later. After clicking OK, the Key will no longer be fully displayed. You can only delete and regenerate the Key!

open source project

The project is developed based on openwechat, WeChat SDK, please move to this warehouse to view:

In view of the difficulty of accessing Github in China, you can use a proxy:


method one

Both Windows and Linux are available, but the machine needs a Golang environment. Reference: Linux Server Build and Deploy GO Environment

Then compile and run the project directly. It is recommended that children’s shoes with certain skills read this part, and those who don’t understand the second method of moving technology .

  • Pull the code and install dependencies.

     git clone cd wechat-chatGPT go mod tidy
  • Start and run the project

     go run main.go

way two

This part is recommended for children’s shoes references who don’t know much about technology or find it troublesome to compile, and deploy it with a stud!

Both Windows and Linux are available, and the Golang environment is not required locally. Download the executable file and start running directly.

Download address:


Download the executable file and configuration file (config.json) required by your system, pay attention to modify the configuration file (described below)!

Note: Executable files and configuration files are placed in the same directory!


Start and run, Windows can directly double-click to run!

Modify the configuration file

New configuration file config.json

 { "api_key": "your api key", "auto_pass": true }
  • Your api key location, paste the API key you obtained above.
  • auto_pass Whether to automatically pass friend requests (if many people add friends, it is recommended to set it to false, because frequent friend requests will cause the program to crash)

start running

After the program starts successfully, the browser will pop up a QR code. Just use your WeChat (WeChat robot) to scan the QR code to log in.

If it starts on the Linux server, open the URL of the picture in the log in your browser and scan the code.

访问下面网址扫描二维码登录 2022/12/11 08:19:50 扫码成功,请在手机上确认登录2022/12/11 08:20:01 登录成功

After the WeChat login is successful, there is an additional storage.json file in the directory where the executable file is located.

The next time you start the program, you don’t need to scan the QR code to log in to WeChat and you can use it!

However, if you switch to another WeChat login, you must delete the storage.json file, otherwise the switch will fail.

 2022/12/11 08:19:33 login error: write storage.json: bad file descriptor

WeChat chat

WeChat robots can answer various questions through @ in group chats or private chats.

private chat


group chat@


Experience Bot

Add iyouhun to WeChat search, send the keyword AI体验and it will be automatically pulled into the experience group

This article is transferred from:
This site is only for collection, and the copyright belongs to the original author.