hello/hello.rs
1use bot_framework::BotWrapper;
2use std::env;
3use telegram_bot::prelude::*;
4
5fn main() {
6 let token = env::var("TELEGRAM_BOT_KEY").expect("TELEGRAM_BOT_KEY not found in env");
7 let mut bot = BotWrapper::new(token);
8 bot.command("hello".into(), |api, msg| {
9 api.spawn(msg.text_reply(format!("Hello, {}!", &msg.from.first_name)));
10 });
11
12 bot.run();
13}