bot-framework 0.1.2

A Telegram Bot framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use bot_framework::BotWrapper;
use std::env;
use telegram_bot::prelude::*;

fn main() {
    let token = env::var("TELEGRAM_BOT_KEY").expect("TELEGRAM_BOT_KEY not found in env");
    let mut bot = BotWrapper::new(token);
    bot.command("hello".into(), |api, msg| {
        api.spawn(msg.text_reply(format!("Hello, {}!", &msg.from.first_name)));
    });

    bot.run();
}