首先打开GitHub项目,https://github.com/RainEggplant/chatgpt-telegram-bot
git clone https://github.com/RainEggplant/chatgpt-telegram-bot.git
下载源代码chatgpt-telegram-bot-2.1.1.zip

解压缩
apt install unzip
unzip chatgpt-telegram-bot-2.1.1.zip
切换到当前目录
cd chatgpt-telegram-bot-2.1.1
cd config
编辑default.json文件
填写Telegram token值、type改为unofficial、填写accessToken值

如何获取accessToken值
https://chat.openai.com/api/auth/session
创建local.json文件
cp default.json local.json
执行下面命令
pnpm install
pnpm build && pnpm start
安装screen
apt-get install screen
后台运行
screen -S chatgpt
pnpm build && pnpm start
还可以使用Docker命令以启动机器人
docker run -d -v ./config:/app/config raineggplant/chatgpt-telegram-bot:latest
2个反向代理URL:
https://ai.fakeopen.com/api/conversation
https://api.pawan.krd/backend-api/conversation