A Telegram bot that integrates with OpenAI's ChatGPT to provide answers. Ready to use with minimal configuration required. Based on acheong08/ChatGPT
- Python 3.10+ and Pipenv
- A Telegram bot and its token (see tutorial)
- An OpenAI account (see configuration section)
- Clone the repository and navigate to the project directory:
git clone https://github.com/n3d1117/chatgpt-telegram-bot.git
cd chatgpt-telegram-bot
- Create a new virtual environment with Pipenv and install the required dependencies:
pipenv install
- Activate the virtual environment:
pipenv shell
Customize the configuration by copying .env.example
and renaming it to .env
, then editing the settings as desired.
OPENAI_EMAIL="<YOUR_OPENAI_EMAIL>"
OPENAI_PASSWORD="<YOUR_OPENAI_PASSWORD>"
TELEGRAM_BOT_TOKEN="<YOUR_TELEGRAM_BOT_TOKEN>"
ALLOWED_TELEGRAM_USER_IDS="<USER_ID_1>,<USER_ID_2>,..."
You'll need to provide:
- Your OpenAI credentials (these are only sent to the OpenAI server to periodically refresh the access token and never shared). You can read more about it here
- Your Telegram bot's token, obtained using BotFather (see tutorial)
- A comma-separated list of Telegram user IDs that are allowed to interact with the bot (use getidsbot to find your user ID). If you'd like to allow everyone instead, see #6.
Use the following command to start the bot:
python main.py
- ChatGPT from OpenAI
- acheong08/ChatGPT for reverse engineering ChatGPT APIs
- python-telegram-bot
This is a personal project and is not affiliated with OpenAI in any way.
This project is released under the terms of the GPL 2.0 license. For more information, see the LICENSE file included in the repository.