mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
19 lines
430 B
Rust
19 lines
430 B
Rust
// This bot throws a dice on each incoming message.
|
|
|
|
use teloxide::prelude2::*;
|
|
|
|
type TeleBot = AutoSend<Bot>;
|
|
|
|
#[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: TeleBot| async move {
|
|
bot.send_dice(message.chat.id).await?;
|
|
respond(())
|
|
})
|
|
.await;
|
|
}
|