Rust Library for creating a Telegram Bot
Clone or download
knsd Merge pull request #101 from yuyoyuppe/messageentity-fix
Expose MessageEntity's fields
Latest commit a2db637 May 1, 2018

Rust Telegram Bot Library

Build Status License

Documentation: Latest version master

A library for writing your own Telegram bots. More information here. Official API here.


Here is a simple example (see example/

extern crate futures;
extern crate telegram_bot;
extern crate tokio_core;

use std::env;

use futures::Stream;
use tokio_core::reactor::Core;
use telegram_bot::*;

fn main() {
    let mut core = Core::new().unwrap();

    let token = env::var("TELEGRAM_BOT_TOKEN").unwrap();
    let api = Api::configure(token).build(core.handle()).unwrap();

    // Fetch new updates via long poll method
    let future =|update| {

        // If the received update contains a new message...
        if let UpdateKind::Message(message) = update.kind {

            if let MessageKind::Text {ref data, ..} = message.kind {
                // Print received text message to stdout.
                println!("<{}>: {}", &message.from.first_name, data);

                // Answer message with "Hi".
                    format!("Hi, {}! You just wrote '{}'", &message.from.first_name, data)


You can find a bigger examples in the examples.


This library is available via In order to use it, just add this to your Cargo.toml:

telegram-bot = "0.6"


Yes 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.