An open API service indexing awesome lists of open source software.

https://github.com/frostwalk/telegram-bot-notifier

Super simple telegram bot that take text as argument and send it to a chat using telegram api.
https://github.com/frostwalk/telegram-bot-notifier

backrest-restic restic telegram

Last synced: 5 months ago
JSON representation

Super simple telegram bot that take text as argument and send it to a chat using telegram api.

Awesome Lists containing this project

README

          

# Telegram Bot Notifier

This is a very simple Telegram bot that sends any argument passed from the command line to a designated chat using the Telegram API. It uses the `teloxide` library.
It is intended to be used inside an already existing Alpine container without modifying the image, so it's statically compiled with target musl.

## Overview

The bot is designed to be used for receiving notifications on Telegram for backups generated by the fantastic piece of software
[**Restic**](https://github.com/restic/restic), as Restic does not natively support Telegram as a notification medium.

## Usage

To send a message using the bot, use the following command:

```sh
TOKEN= CHAT_ID= ./target/release/ "Your message here"
```

Replace `` with your actual bot token and `` with the ID of the chat you want to send messages to. Replace `` with the name of the executable file generated by Cargo.

For example:

```sh
TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 CHAT_ID=000000000 ./target/release/telegram_bot "Test message from Restic."
```

## Environment Variables

- `TOKEN`: The token for your Telegram bot.
- `CHAT_ID`: The ID of the chat where the bot will send messages.

## Example Use Case

This bot is ideal for use with backup notifications from [**Restic**](https://github.com/restic/restic), personally I use
[**Backrest**](https://github.com/garethgeorge/backrest) as web-ui for managing and configuring Restic.
since Backrest is deployed as a container, I needed to create a dependency-free executable that I could mount so that
after the backups are finished, Restic can invoke it passing the result as argument.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

## Acknowledgements
- [**Restic**](https://github.com/restic/restic) for being an awesome backup program.
- [**Backrest**](https://github.com/garethgeorge/backrest) to make it so much easier to manage and configure Restic.
- [**Teloxide**](https://github.com/teloxide/teloxide) for providing the Rust bindings for the Telegram Bot API.
- [**Tokio**](https://tokio.rs/) for providing an amazing library for multithreading.