Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scristobal/telegramgpt
Like ChatGPT but in Telegram
https://github.com/scristobal/telegramgpt
bot chatgpt chatgpt-bot openai telegram telegram-bot
Last synced: about 4 hours ago
JSON representation
Like ChatGPT but in Telegram
- Host: GitHub
- URL: https://github.com/scristobal/telegramgpt
- Owner: scristobal
- Created: 2023-03-19T19:01:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-29T12:29:29.000Z (6 months ago)
- Last Synced: 2024-04-29T13:45:51.095Z (6 months ago)
- Topics: bot, chatgpt, chatgpt-bot, openai, telegram, telegram-bot
- Language: Rust
- Homepage:
- Size: 67.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TelegramGPT 🤖💬
Like ChatGPT but in Telegram
A Telegram bot that uses OpenAI's chat completion API in the backend. That is the same backend as ChatGPT.
## Config
### Telegram and OpenAI tokens
Set your [Telegram bot token](https://core.telegram.org/bots/features#creating-a-new-bot) with `TELOXIDE_TOKEN` and your [OpenAI API key](https://platform.openai.com/account/api-keys) with `OPENAI_API_KEY`. Access to `gpt-4` is required.
### Storage (optional)
Optionally you can store the dialogs using a Redis or SQLite. This prevents your conversations to wipe when the bot is restarted.
To setup Redis use `REDIS_URL` and to setup SQLite use `SQLITE_FILE`. Redis has priority over SQLite. If none is set memory storage is used.
## Run
### Locally
Rename `.env.template` to `.env` and fill in with your secrets. Launch the bot with `cargo run`. If you don't have rust, you need to [install Rust](https://www.rust-lang.org/tools/install).
### Docker
Arguably, the easiest way to get it running is to use Docker. This does not require rust to be installed, but you need [Docker engine](https://docs.docker.com/engine/install/) and (optionally) [docker compose](https://docs.docker.com/compose/install/).
### Cloud
Even simpler would be to deploy on cloud, but it might cost you money. A [fly.io](https://fly.io/docs/languages-and-frameworks/dockerfile/) config file is provided, you can also deploy a [Redis](https://fly.io/docs/reference/redis/) over there. Free tier works jut fine for a few users.
## Usage
The bot will answer to private messages as you would expect. On groups it will only answer to reply messages, it has no access to any other messages. Start a new conversation with `/start`.