## 欢迎使用`wechatgpt`智能机器人,Let's Chat with ChatGPT 如果觉得不错,请麻烦点个`Star`,非常感谢。(最新己经添加了docker部署的方式)
## 仓库地址 https://github.com/houko/wechatgpt ## 准备运行环境 ``` go mod tidy cp config/config.yaml.example local/config.yaml ``` ## 修改你的token 打开 [openai](https://beta.openai.com/account/api-keys) 并注册一个账号, 生成一个apiKey并把apiKey放到`local/config.yaml` 的token下,请看如下示例: ``` chatgpt: wechat: 小莫 token: sk-pKHZD1fLYqXDjjsdsdsdUvIODTT3ssjdfadsJC2gTuqqhTum telegram: your telegram token ``` 大陆用户注册`openai`请参考 [注册ChatGPT详细指南](https://sms-activate.org/cn/info/ChatGPT) ## 运行App ``` go run main.go ``` ## `Docker` 方式运行`wechatgpt` `建议单独跑多个docker以免互相影响` 同时启动微信和telegram,微信登陆的地址请查看运行日志 ``` # apple silicon docker run -d \ --name="wechatgpt" \ -e apiKey="你的chatgpt apiKey" \ -e wechat="微信触发关键字" \ -e telegram="你的telegram token" \ xiaomoinfo/wechatgpt:latest # linux amd64 docker run -d \ --name="wechatgpt" \ -e apiKey="你的chatgpt apiKey" \ -e wechat="微信触发关键字" \ -e telegram="你的telegram token" \ xiaomoinfo/wechatgpt-amd64:latest ``` 如果只想运行微信智能机器人的话运行下面这段代码,微信登陆的地址请查看运行日志 ``` # apple silicon docker run -d \ --name wechatgpt \ -e apiKey="你的chatgpt apiKey" \ -e wechat="微信触发关键字" \ xiaomoinfo/wechatgpt:latest # linux amd64 docker run -d \ --name wechatgpt \ -e apiKey="你的chatgpt apiKey" \ -e wechat="微信触发关键字" \ xiaomoinfo/wechatgpt-amd64:latest ``` 如果只想运行`telegram`智能机器人的话运行下面这段代码 ``` # apple silicon docker run -d \ --name wechatgpt \ -e apiKey="你的chatgpt apiKey" \ -e telegram="你的telegram token" \ xiaomoinfo/wechatgpt:latest # linux amd64 docker run -d \ --name wechatgpt \ -e apiKey="你的chatgpt apiKey" \ -e telegram="你的telegram token" \ xiaomoinfo/wechatgpt-amd64:latest ``` 如果运行`telegram`智能机器人时只希望指定的人使用,白名单以外的人发消息机器人不会回复 ``` # apple silicon docker run -d \ --name wechatgpt \ -e apiKey="你的chatgpt apiKey" \ -e telegram="你的telegram token" \ -e tg_whitelist="username1,username2" \ xiaomoinfo/wechatgpt:latest # linux amd64 docker run -d \ --name wechatgpt \ -e apiKey="你的chatgpt apiKey" \ -e telegram="你的telegram token" \ -e tg_whitelist="username1,username2" \ xiaomoinfo/wechatgpt-amd64:latest ```