Installation Preparation: One VPS, Telegram API, OpenAI API key
Open source project address: https://github.com/karfly/chatgpt_telegram_bot
-
SSH connection tool Fianlshell download link: https://www.hostbuf.com/t/988.html
-
Get Telegram API and get OpenAI API key
Details can be found at api.telegram.org
- Download and install the open source project
__
Install git
apt install git
Clone the open source project
git clone https://github.com/karfly/chatgpt_telegram_bot.git
Enter the file directory
cd /root/chatgpt_telegram_bot
Change the file names
mv config/config.example.yml config/config.yml
mv config/config.example.env config/config.env
Double-click to open the config.yml file and add the Telegram API and OpenAI API keys prepared earlier
- Install Docker and Docker Compose
Install Docker
apt update
apt install curl
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
Docker management
systemctl start docker # Start the container
systemctl enable docker # Enable auto-start on boot
systemctl status docker # Check status
docker --version # Check Docker version
Install Docker Compose
apt-get install docker-compose
Restart the server
reboot
Enter the file directory again
cd /root/chatgpt_telegram_bot
Execute the installation
docker-compose --env-file config/config.env up --build
- Robot usage commands
/retry - Regenerate the last robot answer
/new - Start a new conversation
/mode - Select chat mode
/balance - Display balance
/help - Display help