teloxide/examples/dices.rs
2022-02-02 06:28:32 +06:00

17 lines
405 B
Rust

// This bot throws a dice on each incoming message.
use teloxide::prelude2::*;
#[tokio::main]
async fn main() {
teloxide::enable_logging!();
log::info!("Starting dices_bot...");
let bot = Bot::from_env().auto_send();
teloxide::repls2::repl(bot, |message: Message, bot: AutoSend<Bot>| async move {
bot.send_dice(message.chat.id).await?;
respond(())
})
.await;
}