https://github.com/sharafatkarim/openai-telegram
A minimal, lightweight and simple telegram bot, built with chatgpt API to generate responses and images.
https://github.com/sharafatkarim/openai-telegram
chat-gpt-3 python telegram-bot
Last synced: 2 months ago
JSON representation
A minimal, lightweight and simple telegram bot, built with chatgpt API to generate responses and images.
- Host: GitHub
- URL: https://github.com/sharafatkarim/openai-telegram
- Owner: SharafatKarim
- License: mit
- Created: 2023-05-05T09:38:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-30T01:43:15.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T20:48:29.475Z (4 months ago)
- Topics: chat-gpt-3, python, telegram-bot
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAI Telegram Bot
A minimal, lightweight and simple telegram bot built with chatgpt API from [OpenAI](https://openai.com/) and [python-telegram-bot](https://github.com/python-telegram-bot/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[](https://choosealicense.com/licenses/mit/)

> This project is also available with Telegraf library in Node.js (both servered or, serverless).
> - [openai-telegram-bot](https://github.com/sr-tamim/openai-telegram-bot/)## Environment Variables
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](https://t.me/BotFather).
## Run Locally
Clone the project
```bash
git clone https://github.com/SharafatKarim/openai-telegram
```Go to the project directory
```bash
cd my-project
```Install dependencies
```bash
pip install -r requirements.txt
```Run the bot
```bash
python main.py
```## Deployment
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!
## Screenshots

## Authors
[](https://github.com/sr-tamim)
[](https://github.com/SharafatKarim)## Contribution
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!