{"id":16835176,"url":"https://github.com/syfaro/tgbotapi-rs","last_synced_at":"2025-06-18T13:40:37.403Z","repository":{"id":71917753,"uuid":"246245581","full_name":"Syfaro/tgbotapi-rs","owner":"Syfaro","description":"A Rust library for using the Telegram Bot API","archived":false,"fork":false,"pushed_at":"2024-07-29T10:13:14.000Z","size":159,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T08:02:16.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Syfaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-03-10T08:24:40.000Z","updated_at":"2025-02-02T17:02:35.000Z","dependencies_parsed_at":"2024-02-10T03:20:50.431Z","dependency_job_id":"33f6e465-f6fb-4f4a-a98b-c657d19c569e","html_url":"https://github.com/Syfaro/tgbotapi-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syfaro%2Ftgbotapi-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syfaro%2Ftgbotapi-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syfaro%2Ftgbotapi-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syfaro%2Ftgbotapi-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Syfaro","download_url":"https://codeload.github.com/Syfaro/tgbotapi-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248182009,"owners_count":21060891,"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-13T12:09:12.229Z","updated_at":"2025-04-10T07:49:30.918Z","avatar_url":"https://github.com/Syfaro.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tgbotapi\n\nAn async Rust library for working with the Telegram Bot API.\n\n**This project is not yet complete but provides most of the core experience.**\n\nIt makes no assumptions about how you are using the API and only provides types and wrappers around the Bot API.\n\nIt defines a common trait, `TelegramRequest` that all requests implement. This trait supports dynamic endpoints, arbitrary values (as long as they can be serialized into JSON with serde), and file uploads (including multiple files).\n\n## Examples\n\n```rust\nuse tgbotapi::{Telegram, requests::{ChatID, GetUpdates, SendMessage}};\n\n// Create a new Telegram instance\nlet telegram = Telegram::new(\"api_token\".into());\n\n// Create a request to get updates with long-polling enabled\nlet mut get_updates = GetUpdates {\n    timeout: Some(30),\n    ..Default::default()\n};\n\n// Loop forever getting new updates\nloop {\n    // Ask Telegram for new updates\n    for update in telegram.make_request(\u0026get_updates).await? {\n        // Increment the offset to tell Telegram we processed the update\n        get_updates.offset = Some(update.update_id + 1);\n\n        // Ignore all non-message updates\n        let message = match update.message {\n            Some(message) =\u003e message,\n            _ =\u003e continue,\n        };\n\n        // Create a request to send a message\n        let send_message = SendMessage {\n            chat_id: message.chat_id(),\n            text: \"Hello, world!\".into(),\n            ..Default::default()\n        };\n\n        // Send the message\n        telegram.make_request(\u0026send_message).await?;\n    }\n}\n```\n\nFor higher-performance bots you should use webhooks.\n\n```rust\nuse tgbotapi::Update;\n\n// Get the body of the request from your web handler\nlet body = get_request_body!();\nlet update: Update = serde_json::from_slice(\u0026body)?;\n\n// Now we can do something with the update\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyfaro%2Ftgbotapi-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyfaro%2Ftgbotapi-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyfaro%2Ftgbotapi-rs/lists"}