Installation Preparation: a 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
-
Obtain Telegram API and OpenAI API key
Details 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
Navigate to the file directory
cd /root/chatgpt_telegram_bot
Change 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 container
systemctl enable docker # 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
Navigate to the file directory again
cd /root/chatgpt_telegram_bot
Execute the installation
docker-compose --env-file config/config.env up --build
- Bot Usage Commands
/retry– Retry generating the last bot response
/new– Start a new conversation
/mode– Choose chat mode
/balance– Display balance
/help– Display help