Message with ChatGPT on Telegram.
- Run the container.
docker run --name telegram_chatgpt -e TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> cccaaannn/telegram_chatgpt:latest
- You should map the db to outside, to keep the chat history after bot restarts.
docker run --name telegram_chatgpt -e TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> -v <YOUR_DB_PATH>:/telegram_chatgpt/db cccaaannn/telegram_chatgpt:latest
- Optionally you can map the logs to a directory.
docker run --name telegram_chatgpt -e TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> -v <YOUR_DB_PATH>:/telegram_chatgpt/db -v <YOUR_LOG_PATH>:/telegram_chatgpt/logs cccaaannn/telegram_chatgpt:latest
- Install dependencies.
pip install -r requirements.txt
2 Run by passing keys
python telegram_chatgpt -t <TELEGRAM_BOT_KEY> -o <OPENAI_API_KEY>
2 You can also set api keys as env variables to run without parameters
export TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY>
export OPENAI_API_KEY=<OPENAI_API_KEY>
python telegram_chatgpt