{"id":16157681,"url":"https://github.com/theawiteb/telepingbot","last_synced_at":"2025-04-07T01:40:55.775Z","repository":{"id":237457840,"uuid":"720533152","full_name":"TheAwiteb/telepingbot","owner":"TheAwiteb","description":"[Mirror] Simple API to ping a telegram bot using superbot (mtproto)","archived":false,"fork":false,"pushed_at":"2024-05-29T15:53:23.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T07:15:49.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://git.4rs.nl/awiteb/telepingbot","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheAwiteb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-18T19:16:27.000Z","updated_at":"2024-07-19T23:27:20.000Z","dependencies_parsed_at":"2024-05-02T02:57:25.199Z","dependency_job_id":"af73a3fa-4e94-41d1-9ecb-e653be301923","html_url":"https://github.com/TheAwiteb/telepingbot","commit_stats":null,"previous_names":["theawiteb/telepingbot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAwiteb%2Ftelepingbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAwiteb%2Ftelepingbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAwiteb%2Ftelepingbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAwiteb%2Ftelepingbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAwiteb","download_url":"https://codeload.github.com/TheAwiteb/telepingbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578627,"owners_count":20961269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T01:50:18.447Z","updated_at":"2025-04-07T01:40:55.746Z","avatar_url":"https://github.com/TheAwiteb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TelePingBot\nA simple API to ping telegram bots and returns if it's online or not. using superbot to send message to the bots (mtproto).\n\n## Why is simple?\nAdd your API tokens in the `tokens.txt` and add the bot usernames in the `bots.txt` and you're ready to go! No need to generate tokens or anything else.\n\n## `tokens.txt` file (rename `tokens.txt.example` to `tokens.txt`)\nThe `tokens.txt` file is where you put your API tokens. You can put as many as you want, but make sure to put one in each line. This is API access tokens, you need to put it in `Authorization` header.\n\n\u003e [!WARNING]\n\u003e\n\u003e Remember to keep this file safe, because anyone can use it to ping your bots.\n\u003e Recommended to generate the tokens with `openssl rand -hex 32` or `uuidgen`.\n\n## `bots.txt` file (rename `bots.txt.example` to `bots.txt`)\nThe `bots.txt` file is where you put your bot usernames, this to make sure to ping the specifics bots only. You can put as many as you want, but make sure to put one in each line.\n\nfor example:\n```\n@BotFather\n@SomeTestBot\n@SomeTestBot\n```\n\n## `.env` file (rename `.env.example` to `.env`)\nYou need to fill the variables in it.\n\n## Requirements\n- Rust (MSRV 1.68.2)\n- Cargo\n\n## Build\n```bash\ncargo build --release\n```\n\n## Run\n```bash\ncargo run --release\n```\nOr just run the binary file in `target/release/telepingbot` (Not recommended because the `.env` file)\n\n## Endpoints\n\n### `/ping/@\u003cbot_username\u003e`\nThis endpoint is to ping the bot and returns if it's online or not.\n\n#### Headers\n- `Authorization`: The API access token. e.g: `Authorization: FirstToken`\n\n#### Response\n- `200`: The bot is online.\n- `404`: The bot is offline.\n- `401`: The API access token is invalid.\n- `500`: Internal server error. e.g: The bot username is invalid or the superbot can't send message to the bot.\n\n#### Example\n\u003e [!NOTE]\n\u003e \n\u003e Replace `FirstToken` with your API access token and `@testbot` with your bot username\n\u003e and the host and port with your host and port.\n\n```bash\ncurl -v 0.0.0.0:3939/ping/@testbot -H \"Authorization: FirstToken\"\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheawiteb%2Ftelepingbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheawiteb%2Ftelepingbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheawiteb%2Ftelepingbot/lists"}