{"id":13606105,"url":"https://github.com/telegram-rs/telegram-bot","last_synced_at":"2025-04-12T08:30:24.446Z","repository":{"id":34236656,"uuid":"38103923","full_name":"telegram-rs/telegram-bot","owner":"telegram-rs","description":"Rust Library for creating a Telegram Bot","archived":false,"fork":false,"pushed_at":"2023-03-02T09:13:48.000Z","size":16466,"stargazers_count":945,"open_issues_count":52,"forks_count":158,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-04-11T18:54:45.866Z","etag":null,"topics":["telegram","telegram-bot","tokio"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telegram-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2015-06-26T09:55:12.000Z","updated_at":"2025-03-25T08:30:50.000Z","dependencies_parsed_at":"2024-01-14T06:52:56.918Z","dependency_job_id":"c5a1e541-75e4-419b-b08a-c99097e4ee36","html_url":"https://github.com/telegram-rs/telegram-bot","commit_stats":{"total_commits":521,"total_committers":37,"mean_commits":14.08108108108108,"dds":0.3877159309021113,"last_synced_commit":"65ad5cfd578e9a1260ce6daac714eb2153c0bec7"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telegram-rs%2Ftelegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telegram-rs%2Ftelegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telegram-rs%2Ftelegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telegram-rs%2Ftelegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telegram-rs","download_url":"https://codeload.github.com/telegram-rs/telegram-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248539743,"owners_count":21121226,"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":["telegram","telegram-bot","tokio"],"created_at":"2024-08-01T19:01:06.089Z","updated_at":"2025-04-12T08:30:23.782Z","avatar_url":"https://github.com/telegram-rs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"Rust Telegram Bot Library\n=========================\n[![Build Status](https://img.shields.io/travis/telegram-rs/telegram-bot/master.svg)](https://travis-ci.org/telegram-rs/telegram-bot)\n[![Tests](https://github.com/telegram-rs/telegram-bot/workflows/Tests/badge.svg)](https://github.com/telegram-rs/telegram-bot/actions?workflow=Tests)\n[![Tests](https://github.com/telegram-rs/telegram-bot/workflows/Fmt/badge.svg)](https://github.com/telegram-rs/telegram-bot/actions?workflow=Fmt)\n[![License](https://img.shields.io/github/license/telegram-rs/telegram-bot.svg)]()\n[![Crates.io](https://img.shields.io/crates/v/telegram-bot.svg)](https://crates.io/crates/telegram-bot)\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003eDocumentation:\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://docs.rs/telegram-bot/\"\u003eLatest crates.io version\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://telegram-rs.github.io/telegram-bot/telegram_bot/\"\u003e\u003ccode\u003emaster\u003c/code\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nA library for writing your own [Telegram](https://telegram.org/) bots. More information [here](https://core.telegram.org/bots). Official API [here](https://core.telegram.org/bots/api).\n\n## Example\nHere is a simple example (see [`example/simple.rs`](https://github.com/telegram-rs/telegram-bot/blob/master/lib/examples/simple.rs)):\n\n``` rust\nuse std::env;\n\nuse futures::StreamExt;\nuse telegram_bot::*;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Error\u003e {\n    let token = env::var(\"TELEGRAM_BOT_TOKEN\").expect(\"TELEGRAM_BOT_TOKEN not set\");\n    let api = Api::new(token);\n\n    // Fetch new updates via long poll method\n    let mut stream = api.stream();\n    while let Some(update) = stream.next().await {\n        // If the received update contains a new message...\n        let update = update?;\n        if let UpdateKind::Message(message) = update.kind {\n            if let MessageKind::Text { ref data, .. } = message.kind {\n                // Print received text message to stdout.\n                println!(\"\u003c{}\u003e: {}\", \u0026message.from.first_name, data);\n\n                // Answer message with \"Hi\".\n                api.send(message.text_reply(format!(\n                    \"Hi, {}! You just wrote '{}'\",\n                    \u0026message.from.first_name, data\n                )))\n                .await?;\n            }\n        }\n    }\n    Ok(())\n}\n```\nYou can find a bigger examples in the `examples`.\n\n## Usage\nThis library is available via `crates.io`. In order to use it, just add this to your `Cargo.toml`:\n\n```\ntelegram-bot = \"0.7\"\n```\n\nThe library allows you to do E2E-testing of your bot easily: just specify `TELEGRAM_API_URL` environment variable to point to your fake Telegram test server.\nA lot of diagnostic information can be collected with [tracing](https://crates.io/crates/tracing) framework, see [`example/tracing.rs`](https://github.com/telegram-rs/telegram-bot/blob/master/lib/examples/tracing.rs)).\n\n## Collaboration\nYes please! Every type of contribution is welcome: Create issues, hack some code or make suggestions. Don't know where to start? Good first issues are tagged with [up for grab](https://github.com/telegram-rs/telegram-bot/issues?q=is%3Aissue+is%3Aopen+label%3A%22up+for+grab%22).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelegram-rs%2Ftelegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelegram-rs%2Ftelegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelegram-rs%2Ftelegram-bot/lists"}