teloxide/examples/throw_dice.rs
2022-10-03 17:07:38 +06:00

17 lines
364 B
Rust

// This bot throws a dice on each incoming message.
use teloxide::prelude::*;
#[tokio::main]
async fn main() {
pretty_env_logger::init();
log::info!("Starting throw dice bot...");
let bot = Bot::from_env();
teloxide::repl(bot, |msg: Message, bot: Bot| async move {
bot.send_dice(msg.chat.id).await?;
Ok(())
})
.await;
}