telegram-bot 0.6.1

A library for creating Telegram bots
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate telegram_bot;
extern crate tokio_core;

use std::env;

use tokio_core::reactor::Core;
use telegram_bot::{Api, GetMe};

fn main() {
    let token = env::var("TELEGRAM_BOT_TOKEN").unwrap();

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

    let api = Api::configure(token).build(core.handle()).unwrap();
    let future = api.send(GetMe);

    println!("{:?}", core.run(future))
}