teloxide/examples/dices.rs
2022-03-29 01:55:09 +06:00

17 lines
394 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 dices_bot...");
let bot = Bot::from_env().auto_send();
teloxide::repl(bot, |message: Message, bot: AutoSend<Bot>| async move {
bot.send_dice(message.chat.id).await?;
respond(())
})
.await;
}