bytesnake / telebot

Write Telegram bots in Rust with Tokio and Futures
Other
212 stars 33 forks source link

CallbackQuery handle implementation #68

Closed lexfrl closed 5 years ago

lexfrl commented 5 years ago

Usage:

fn main() {
    let mut handler = Core::new().unwrap();
    let bot = bot::RcBot::new(handler.handle(), cfg.bot_token())
        .update_interval(200);
    let callback = bot.callback().and_then(|(bot, msg)| {
        bot.answer_callback_query(msg.id).text(msg.data.unwrap().to_string()).send()
    });

    bot.register(callback);
    bot.run(&mut handler).unwrap();
}
bytesnake commented 5 years ago

Thanks :)