A minimal, lightweight and simple telegram bot built with chatgpt API from OpenAI and python-telegram-bot. It can genrate text messages and images and can be used both personally or inside a group!
API used
- OpenAI GPT-3.5 for chat response
- DALL-E for image response
This project is also available with Telegraf library in Node.js (both servered or, serverless).
To run this project, you will need to add the following environment variables to your .env file
API_KEY
collect from your openai account. From the setting you can generate API key.
BOT_API
Telegram
BOT_API
can be generated from Bot father telegram bot.
Clone the project
git clone https://github.com/SharafatKarim/openai-telegram
Go to the project directory
cd my-project
Install dependencies
pip install -r requirements.txt
Run the bot
python main.py
This bot can deployed to web services like railway or heroku or any vps. For vps follow the above guide. Railway should work out of the box. Just fork this repository, fill up environment variables. As simple as that!
Feel free to fork and open pull requests. Also you are very welcomes to apply new pathes or create a more advanced version of this project. Your imagination is your limits!