mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
34ebbe6bef
Former-commit-id: 2537f06464
17 lines
399 B
Rust
17 lines
399 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().auto_send();
|
|
|
|
teloxide::repl(bot, |message: Message, bot: AutoSend<Bot>| async move {
|
|
bot.send_dice(message.chat.id).await?;
|
|
respond(())
|
|
})
|
|
.await;
|
|
}
|