mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
17 lines
372 B
Rust
17 lines
372 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, |message: Message, bot: Bot| async move {
|
|
bot.send_dice(message.chat.id).await?;
|
|
Ok(())
|
|
})
|
|
.await;
|
|
}
|