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