{"id":26754931,"url":"https://github.com/callieve/telexide","last_synced_at":"2025-04-15T02:51:35.631Z","repository":{"id":48618196,"uuid":"254634204","full_name":"CalliEve/telexide","owner":"CalliEve","description":"an easy-to-use async telegram bot library for Rust","archived":false,"fork":false,"pushed_at":"2024-07-28T17:18:36.000Z","size":392,"stargazers_count":39,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T02:51:30.373Z","etag":null,"topics":["hacktoberfest","rust","rust-lang","rust-library","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"","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/CalliEve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-04-10T12:54:09.000Z","updated_at":"2025-03-03T08:50:33.000Z","dependencies_parsed_at":"2024-01-04T17:28:10.932Z","dependency_job_id":"50c13401-544f-4465-b08a-ec9e7928872f","html_url":"https://github.com/CalliEve/telexide","commit_stats":{"total_commits":49,"total_committers":7,"mean_commits":7.0,"dds":0.326530612244898,"last_synced_commit":"a13091274e2f8b4843706423ab32a3b86eb04ea5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalliEve%2Ftelexide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalliEve%2Ftelexide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalliEve%2Ftelexide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalliEve%2Ftelexide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CalliEve","download_url":"https://codeload.github.com/CalliEve/telexide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997086,"owners_count":21195797,"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":["hacktoberfest","rust","rust-lang","rust-library","telegram","telegram-bot"],"created_at":"2025-03-28T14:17:13.974Z","updated_at":"2025-04-15T02:51:35.599Z","avatar_url":"https://github.com/CalliEve.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telexide\n\n[![Crate](https://img.shields.io/crates/v/telexide?style=flat-square)](https://crates.io/crates/telexide)\n[![Docs](https://docs.rs/telexide/badge.svg)](https://docs.rs/telexide)\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fcallieve%2Ftelexide%2Fbadge\u0026style=flat-square)](https://actions-badge.atrox.dev/callieve/telexide/goto)\n[![Rust Version](https://img.shields.io/badge/rust-1.70.0+-93450a.svg?style=flat-square)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)\n\nTelexide is an easy to use library for making a telegram bot, built on tokio and hyper.\n\nView the [examples] on how to make and structure a bot.\n\nUse the [`ClientBuilder`] to easily create a [`Client`] object to your\npreferences and register commands with the [`create_framework`] macro and/or\nregister your own update handlers, before running [`Client::start`] to start\nyour bot. All of this is designed to be highly customisable. For further\ninformation about the client, please see the [client's module-level\ndocumentation][client].\n\nAPI calls are easy to make using the [`APIClient`] and the api data models,\nor create and use your own api client by implementing the [`API`] trait. For\nfurther information about the api client, please see the [api's module-level\ndocumentation][api].\n\nA default command framework is provided using the [`Framework`] object,\nproviding easy handling of incoming [telegram bot commands][tg_commands]\nsent by users of your bot. For further information about the framework,\nplease see the [framework's module-level documentation][framework].\n\n## Example Bot\n\nA basic ping-pong bot can be written like:\n\n```rust\nuse std::env;\nuse telexide::{api::types::SendMessage, prelude::*};\n\n#[command(description = \"just a ping-pong command\")]\nasync fn ping(context: Context, message: Message) -\u003e CommandResult {\n    context\n        .api\n        .send_message(SendMessage::new(message.chat.get_id().into(), \"pong\"))\n        .await?;\n    Ok(())\n}\n\n#[tokio::main]\nasync fn main() -\u003e telexide::Result\u003c()\u003e {\n    let token = env::var(\"BOT_TOKEN\").expect(\"no token environment variable set\");\n    let bot_name = \"ping-pong\";\n\n    ClientBuilder::new()\n        .set_token(\u0026token)\n        .set_framework(create_framework!(bot_name, ping))\n        .build()\n        .start()\n        .await\n}\n```\n\nFor more examples, please see the examples directory.\n\n## Crate Features\n\n- [x] Supports all of the telegram bot API, up to and including version 6.9\n- [x] easy to use and customisable client\n- [x] long-polling based update handling\n  - [x] set your own timeout\n  - [x] set your own limit for updates gotten at once\n- [x] easy to use, macro-based command framework\n- [x] easy to use and heavily customisable api client\n  - [x] use your own hyper client\n  - [x] use your own api struct so you control the get and post methods\n  - [x] includes all telegram api endpoints\n- [x] webhook based update handling\n- [x] builder methods for creating all api call payloads\n\n### Planned\n\n- [ ] choosing what you want from the lib using feature flags\n- [ ] subscribe to non-message events using command (or similar) framework\n  - [ ] run command on receiving an inline query or answer to one\n  - [ ] run command on receiving a poll that matches your requirements\n- [ ] wait\\_for style Context method to wait for an update matching your criteria\n- [ ] methods on models for easier calling of API endpoints (like `ChatMember::kick`)\n\n## Installation\n\nAdd the following to your `Cargo.toml` file:\n\n```toml\n[dependencies]\ntelexide = \"0.1.17\"\n```\n\n### Feature Flags\n\nTelexide uses a set of [feature flags] to allow switching between rustls and native-tls for tls support.\nIn the future flags may be added to enable/disable optional parts of the crate.\n\n- `rustls`: Makes the api client use `hyper-rustls` to create the tls connector. Enabled by default.\n- `native-tls`: Makes the api client use `hyper-tls` to create the tls connector. Overwrites the `rustls` feature if enabled.\n\n## Supported Rust Versions\n\nThe minimum supported version is 1.70. The current Telexide version is not guaranteed to build on Rust versions earlier than the minimum supported version.\n\n[examples]: https://github.com/callieve/telexide/blob/master/examples\n[client]: https://docs.rs/telexide/*/telexide/client/index.html\n[`clientbuilder`]: https://docs.rs/telexide/*/telexide/client/struct.ClientBuilder.html\n[`client`]: https://docs.rs/telexide/*/telexide/client/struct.Client.html\n[`client::start`]: https://docs.rs/telexide/*/telexide/client/struct.Client.html#method.start\n[`apiclient`]: https://docs.rs/telexide/*/telexide/api/struct.APIClient.html\n[`api`]: https://docs.rs/telexide/*/telexide/api/trait.API.html\n[api]: https://docs.rs/telexide/*/telexide/api/index.html\n[`create_framework`]: https://docs.rs/telexide/*/telexide/macro.create_framework.html\n[tg_commands]: https://core.telegram.org/bots#commands\n[`framework`]: https://docs.rs/telexide/*/telexide/framework/struct.Framework.html\n[framework]: https://docs.rs/telexide/*/telexide/framework/index.html\n[feature flags]: https://doc.rust-lang.org/cargo/reference/features.html#the-features-section\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallieve%2Ftelexide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallieve%2Ftelexide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallieve%2Ftelexide/lists"}