https://github.com/osoianmarcel/telegram-openai-bot
Telegram Bot made for communication with OpenAI.
https://github.com/osoianmarcel/telegram-openai-bot
ai bot golang openai telegram telegram-bot
Last synced: 2 months ago
JSON representation
Telegram Bot made for communication with OpenAI.
- Host: GitHub
- URL: https://github.com/osoianmarcel/telegram-openai-bot
- Owner: OsoianMarcel
- License: mit
- Created: 2023-01-04T19:53:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T18:31:17.000Z (over 3 years ago)
- Last Synced: 2025-10-26T05:54:34.866Z (8 months ago)
- Topics: ai, bot, golang, openai, telegram, telegram-bot
- Language: Go
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telegram OpenAI Bot
Telegram Bot made for communication with OpenAI.
*The conversation mode is not implemented.
## Build
To build the executable run:
```
go build ./cmd/tgbot
```
To build the executable for different platforms, check the Go documentation.
## Environment variables
To run this project, you will need to set the following environment variables:
**Required**
`TG_APITOKEN` - Telegram bot API token.
`GPT_AUTH_TOKEN` - OpenAI API key.
**Optional**
`TG_ADMIN_CHATID` - Bot owner chat id (used for feedback command).
`STATS_FILE` - The file path for storing the statistics (JSON format).
## Example
A bot example can be found here https://t.me/ask_openai_bot
Warning: This bot is served from my home Raspberry Pi, so I cannot guarantee 100% uptime.
## TODO
- Store Telegram update offset, and use it on startup.
- Keep sending typing action until the AI responds.
- Flush dirty stats to disk once in X seconds.
- Change the stats model (no user stats, daily, weekly, monthly stats).
- Implement conversational mode.
## Give a Star ⭐
If you find this repository useful, please give it a star to show your support for this project. 😊
## License
All contents of this repository are licensed under the [MIT license].
[MIT license]: https://github.com/OsoianMarcel/telegram-openai-bot/blob/main/LICENSE