telepingbot/README.md
Awiteb 2fc7e8274e
All checks were successful
Write changelog / write-changelog (push) Successful in 24s
Rust CI / Rust CI (push) Successful in 3m23s
chore: Update README.md
Signed-off-by: Awiteb <a@4rs.nl>
2024-05-31 19:06:27 +03:00

1.8 KiB

TelePingBot

A simple API to ping telegram bots and returns if it's online or not. using superbot to send message to the bots (mtproto).

Forgejo CI Status Forgejo CD Status

agplv3-or-later

Why is simple?

Add your API tokens (Authorization header) and your bot usernames in the config.toml file, and you're ready to go.

Note

Check out the config.toml.example file to see how to fill the config.toml file.

Warning

Remember to keep the config.toml file safe, because anyone can use it to ping your bots.

CLI Arguments

  • --config: The path to the config file. (default: config.toml)

Requirements

  • Rust (MSRV 1.75.0)
  • Cargo

Build

cargo build --release

Run

cargo run --release

Or just run the binary file in target/release/telepingbot

Endpoints

/ping/@<bot_username>

This endpoint is to ping the bot and returns if it's online or not.

Headers

  • Authorization: The API access token. e.g: Authorization: FirstToken

Response

  • 200: The bot is online.
  • 404: The bot is offline.
  • 401: The API access token is invalid.
  • 500: Internal server error. e.g: The bot username is invalid or the superbot can't send message to the bot.

Example

Note

Replace FirstToken with your API access token and @testbot with your bot username and the host and port with your host and port.

curl -v 0.0.0.0:3939/ping/@testbot -H "Authorization: FirstToken"