New version of WeChat robot
It is not recommended to use if the account is severely banned.
A WeChat robot based on OpenAI
+ Wechaty
intelligent reply, supporting contextual reply, and AI painting, which can be used to help you automatically reply to WeChat messages.
api.openai.com is not accessible in China, use Cloudflare Workers reverse proxy, tutorial
When your environment is unavailable and you don’t want to build it yourself, you can also use my https://openai.1rmb.tk
.
API Key created successfully. Copy this Key and use it next. After clicking OK, the Key will no longer be displayed completely. You can only delete it and regenerate the Key! If you don’t have an account, you can refer to this post on V2EX to register the address https://www.v2ex.com/t/900126
# $wechaty-bot
# 执行下面命令,拷贝一份 .env.example 文件
cp .env.example .env
#群聊chatgpt自动回复总开关 0为关闭 1为开启
AutoReplyGroup = 1
#开启chatgpt群聊列表,群聊名称必须与微信群聊名称一致,否则无法自动回复 为空则自动回复所有群聊 ["群聊1","群聊2","群聊3"]
RoomList = [ ]
#好友chatgpt自动回复总开关 0为关闭 1为开启
AutoReplyFriend = 1
#开启chatgpt好友列表,好友名称必须与微信好友名称一致,否则无法自动回复 为空则自动回复所有好友 ["好友1","好友2","好友3"]
FriendList = [ ]
# openai的key,需要自己去获取 ,地址:https://beta.openai.com/account/api-keys
OPENAI_API_KEY = ' sk-xxxxxxxxxxxxxxxxx '
# 反代的api,为空时为默认值 https://api.openai.com
PROXY_API = ' '
Download and edit the .env
configuration file
mkdir my-wechaty-bot && cd my-wechaty-bot
wget -O .env https://raw.githubusercontent.com/x-dr/wechaty-bot/main/.env.example
vim .env
run
docker run -itd --name my-wechaty-bot
--restart=always
-v $PWD /.env:/app/.env
gindex/wechaty-bot:latest
View logs and scan QR code to log in
docker logs my-wechaty-bot -f
Package the docker image yourself
docker build -t wechaty-bot .
docker run -it --rm --name wechaty-bot wechaty-bot
git clone https://github.com/x-dr/wechaty-bot.git
npm i
node app.js
You can scan the QR code to log in.
Start background operation with pm2
npm install pm2 -g
pm2 start app.js
/c xxxx #对话
/c 结束对话 #结束本轮对话
/img xxx
Openai requires payment, and the price is not simply calculated based on the number of requests, including the amount of text in the corresponding content. New accounts have a free credit of $18.
Official price: https://openai.com/api/pricing
@wechaty
@transitive-bullshit