https://github.com/pkarpovich/tg-relay-bot
Forward messages seamlessly from HTTP and SMTP to a Telegram channel
https://github.com/pkarpovich/tg-relay-bot
golang http message-relay smtp telegram-bot
Last synced: 11 months ago
JSON representation
Forward messages seamlessly from HTTP and SMTP to a Telegram channel
- Host: GitHub
- URL: https://github.com/pkarpovich/tg-relay-bot
- Owner: pkarpovich
- License: mit
- Created: 2024-05-11T21:08:36.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T16:44:38.000Z (about 2 years ago)
- Last Synced: 2024-05-12T22:27:13.343Z (about 2 years ago)
- Topics: golang, http, message-relay, smtp, telegram-bot
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tg-relay-bot
## Introduction
`tg-relay-bot` is a universal messaging bot that bridges communication between HTTP requests or SMTP emails and a
Telegram bot channel. This service is particularly useful for integrating Telegram notifications into various web
services, alert systems, or any application requiring immediate message forwarding to a Telegram channel.
## Features
- **HTTP and SMTP Integration**: Accepts incoming messages from both HTTP requests and SMTP emails.
- **Telegram Forwarding**: Automatically forwards messages to a designated Telegram bot channel.
## Configuration
You could configure the bot by setting the following environment variables:
- `TELEGRAM_TOKEN`: The Telegram bot token.
- `TELEGRAM_SUPER_USERS`: A comma-separated list of Telegram user IDs that are allowed to interact with the bot.
- `HTTP_SECRET`: The secret key for authenticating incoming HTTP requests.
- `SMTP_ALLOWED_HOSTS`: A comma-separated list of allowed email domains.
## Usage
### Sending a Message via HTTP
```bash
curl -X POST http://localhost:8080/send -d '{"message": "Your message here"}'
```
### Sending a Message via SMTP
Send an email to the configured SMTP server and it will be automatically forwarded to the Telegram channel.
## Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.