mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Added sugar to examples
This commit is contained in:
parent
9f7d980a70
commit
c9a0fe452d
1 changed files with 3 additions and 2 deletions
|
@ -6,8 +6,9 @@ use rand::Rng;
|
||||||
use teloxide::{
|
use teloxide::{
|
||||||
dispatching::HandlerExt,
|
dispatching::HandlerExt,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
types::{Dice, ReplyParameters},
|
types::Dice,
|
||||||
utils::command::BotCommands,
|
utils::command::BotCommands,
|
||||||
|
sugar::request::RequestReplyExt,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
@ -84,7 +85,7 @@ async fn main() {
|
||||||
// filter only messages with dices.
|
// filter only messages with dices.
|
||||||
Message::filter_dice().endpoint(|bot: Bot, msg: Message, dice: Dice| async move {
|
Message::filter_dice().endpoint(|bot: Bot, msg: Message, dice: Dice| async move {
|
||||||
bot.send_message(msg.chat.id, format!("Dice value: {}", dice.value))
|
bot.send_message(msg.chat.id, format!("Dice value: {}", dice.value))
|
||||||
.reply_parameters(ReplyParameters::new(msg.id))
|
.reply_to(msg)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue