telegram-bot 0.8.0

A library for creating Telegram bots
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::env;

use futures::StreamExt;
use telegram_bot::*;

#[tokio::main]
async fn main() {
    let token = env::var("TELEGRAM_BOT_TOKEN").expect("TELEGRAM_BOT_TOKEN not set");
    let mut stream = Api::new(token).stream();

    // Print update or error for each update.
    while let Some(mb_update) = stream.next().await {
        println!("{:?}", mb_update);
    }
}