throw_dice/throw_dice.rs
1// This bot throws a dice on each incoming message.
2
3use teloxide::prelude::*;
4
5#[tokio::main]
6async fn main() {
7 pretty_env_logger::init();
8 log::info!("Starting throw dice bot...");
9
10 let bot = Bot::from_env();
11
12 teloxide::repl(bot, |bot: Bot, msg: Message| async move {
13 bot.send_dice(msg.chat.id).await?;
14 Ok(())
15 })
16 .await;
17}