Connect ChatGPT To Telegram Bot
- Python3
- OpenAI
- Telegram Bot
- create virtual enviroment follow command below:
python3 -m venv env
Then activate command for MacOS or Linux:
source env/bin/activate
or command for Windows:
env\Scripts\activate.bat
Next step install dependency:
pip install -r requirements.txt
Next rename env.sample to .env file.
Register an account with OpenAI and then go to this link https://beta.openai.com/account/api-keys and create token. Paste Token to .env with OPENAI_API_KEY variable.
Open Telegram App and search for @BotFather Send /newbot to BotFather and follow the instruction with BotFather.
Finally, Copy bot token to .env file with TELEGRAM_API_KEY variable.
python3 main.py