#telegram-bot #telegram-api #bot #telegram #bot-api #hyper-client #api-calls


(working) Fork of Telexide: An async Rust library for the telegram bot API

5 releases

0.2.3 Aug 28, 2023
0.2.2 Feb 23, 2023
0.2.1 Dec 3, 2021
0.2.0 Dec 3, 2021
0.1.11 Dec 3, 2021

#994 in Web programming

Download history 2/week @ 2024-02-14 5/week @ 2024-02-21 14/week @ 2024-02-28 5/week @ 2024-03-06 13/week @ 2024-03-13 5/week @ 2024-03-20 4/week @ 2024-03-27 13/week @ 2024-04-03 122/week @ 2024-04-10 1/week @ 2024-04-17 1/week @ 2024-04-24

125 downloads per month
Used in telegram-raf

Custom license


Crate Docs Build Status Rust Version


Telexide is an easy to use library for making a telegram bot, built on tokio and hyper.

View the examples on how to make and structure a bot.

Use the ClientBuilder to easily create a Client object to your preferences and register commands with the create_framework macro and/or register your own update handlers, before running Client::start to start your bot. All of this is designed to be highly customisable. For further information about the client, please see the client's module-level documentation.

API calls are easy to make using the APIClient and the api data models, or create and use your own api client by implementing the API trait. For further information about the api client, please see the api's module-level documentation.

A default command framework is provided using the Framework object, providing easy handling of incoming telegram bot commands sent by users of your bot. For further information about the framework, please see the framework's module-level documentation.

Example Bot

A basic ping-pong bot can be written like:

use std::env;
use telexide_fork::{api::types::SendMessage, prelude::*};

#[command(description = "just a ping-pong command")]
async fn ping(context: Context, message: Message) -> CommandResult {
        .send_message(SendMessage::new(message.chat.get_id(), "pong"))

async fn main() -> telexide_fork::Result<()> {
    let token = env::var("BOT_TOKEN").expect("no token environment variable set");

        create_framework!("ping-pong", ping),

For more examples, please see the examples dir.


  • easy to use and customisable client
  • long-polling based update handling
    • set your own timeout
    • set your own limit for updates gotten at once
  • easy to use, macro-based command framework
  • easy to use and heavily customisable api client
    • use your own hyper client
    • use your own api struct so you control the get and post methods
    • includes all telegram api endpoints
  • webhook based update handling


  • choosing what you want from the lib using feature flags
  • subscribe to non-message events using command (or similar) framework
    • run command on receiving an inline query or answer to one
    • run command on receiving a poll that matches your requirements
  • wait_for style Context method to wait for an update matching your criteria
  • more builder methods for creating api data
  • methods on models for easier calling of API endpoints (like ChatMember::kick)


Add the following to your Cargo.toml file:

telexide = "0.1.6"

Supported Rust Versions

The minimum supported version is 1.46. The current Telexide version is not guaranteed to build on Rust versions earlier than the minimum supported version.


~310K SLoC