Added sugar to examples

This commit is contained in:
LasterAlex 2024-09-03 14:20:44 +03:00
parent 9f7d980a70
commit c9a0fe452d
No known key found for this signature in database

View file

@ -6,8 +6,9 @@ use rand::Rng;
use teloxide::{
dispatching::HandlerExt,
prelude::*,
types::{Dice, ReplyParameters},
types::Dice,
utils::command::BotCommands,
sugar::request::RequestReplyExt,
};
#[tokio::main]
@ -84,7 +85,7 @@ async fn main() {
// filter only messages with dices.
Message::filter_dice().endpoint(|bot: Bot, msg: Message, dice: Dice| async move {
bot.send_message(msg.chat.id, format!("Dice value: {}", dice.value))
.reply_parameters(ReplyParameters::new(msg.id))
.reply_to(msg)
.await?;
Ok(())
}),