gtoxlili / wechat-chatGPT
- вторник, 13 декабря 2022 г. в 00:38:38
实现微信公众号被动返回接口的ChatGPT
具有微信公众号被动回复用户消息功能的 ChatGPTBot 实现
chat.openai.com
里 Cookie 中的 __Secure-next-auth.session-token 与 cf_clearance$(Token)
替换为你的微信公众号 TokenGOOS=linux GOARCH=amd64 GOARM= GOMIPS= \
CGO_ENABLED=0 \
go build -trimpath -o ./dist/weChatGPT \
-ldflags "-X 'main.wxToken=$(Token)' -w -s -buildid="
config.json
文件请放置与可执行文件同一目录下cf_clearance
可用于绕过 Cloudflare
的防火墙,但请保证获取 cf_clearance
时的 UA 与 IP 与项目实际运行时一致 (本项目默认
UA 为 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
)cf_clearance
这其实是一篇没什么用的README
由于微信公众号的 5s限制 ,虽然本项目已经通过技术将这个限制提升至了 15s,
但绝大多数情况下通过逆向得到的ChatGPT接口的相应速率都超过了这个时间限制。
故本 Bot 几乎无法正常工作,可能以后等 ChatGPT 的正式接口出来,会重构本项目的代码。