2020-07-29 12:02:37 +02:00
|
|
|
// This bot throws a dice on each incoming message.
|
2020-02-18 23:54:41 +01:00
|
|
|
|
2022-03-24 12:25:42 +01:00
|
|
|
use teloxide::prelude::*;
|
2020-01-29 18:43:47 +01:00
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2022-03-21 15:53:59 +01:00
|
|
|
pretty_env_logger::init();
|
2022-04-26 20:56:51 +02:00
|
|
|
log::info!("Starting throw dice bot...");
|
2020-01-29 18:43:47 +01:00
|
|
|
|
2022-09-29 05:37:20 +02:00
|
|
|
let bot = Bot::from_env();
|
2020-02-13 18:23:22 +01:00
|
|
|
|
2022-10-03 13:54:06 +02:00
|
|
|
teloxide::repl(bot, |bot: Bot, msg: Message| async move {
|
2022-10-03 13:07:38 +02:00
|
|
|
bot.send_dice(msg.chat.id).await?;
|
2022-10-02 17:44:04 +02:00
|
|
|
Ok(())
|
2020-07-30 15:07:58 +02:00
|
|
|
})
|
|
|
|
.await;
|
2020-01-29 18:43:47 +01:00
|
|
|
}
|