This repository is a Telegram Bot re-creation of ChatGPT, and it was forked from m1guelpf/chatgpt-telegram. The main difference between this version and the original is that this repository removes the Docker-compose and focuses only on creating a Dockerfile that contains the bot. This makes it easier to host the bot on external services such as Railway by creating a new app from this repository and adding a MongoDB database. All configurations can be set as environmental variables from the Railway website, and no changes are required in the code.
/retry
– Regenerate last bot answer/new
– Start new dialog/mode
– Select chat mode/balance
– Show balance/settings
– Show settings/help
– Show help
-
Get your OpenAI API key
-
Get your Telegram bot token from @BotFather
-
Modify the config/chat_modes.yml with your on ChatGPT modes.
-
Create the external MongoDB dataset on i.e. Railway and get its URL.
-
Build the Docker image:
docker build --target chatgpt-telegram:devel .
-
Start the container while passing the env variables.
docker run --rm -it chatgpt-telegram:devel \ -e TELEGRAM_TOKEN={YOUR TOKEN} \ -e OPENAI_API_KEY={YOUR KEY} \ -e MONGODB_URI={YOUR URI} \ -e ALLOWED_TELEGRAM_USERNAMES={YOUR TELEGRAM USERNAME+OTHERS}