mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 11:43:57 +01:00
Use dialogue.chat_id()
in examples/purchase.rs
This commit is contained in:
parent
1b559802cb
commit
ae48a11b3f
1 changed files with 7 additions and 9 deletions
|
@ -13,7 +13,7 @@
|
||||||
// ```
|
// ```
|
||||||
|
|
||||||
use teloxide::{
|
use teloxide::{
|
||||||
dispatching::dialogue::{self, GetChatId, InMemStorage},
|
dispatching::dialogue::{self, InMemStorage},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
types::{InlineKeyboardButton, InlineKeyboardMarkup},
|
types::{InlineKeyboardButton, InlineKeyboardMarkup},
|
||||||
utils::command::BotCommands,
|
utils::command::BotCommands,
|
||||||
|
@ -124,15 +124,13 @@ async fn receive_product_selection(
|
||||||
full_name: String,
|
full_name: String,
|
||||||
) -> HandlerResult {
|
) -> HandlerResult {
|
||||||
if let Some(product) = &q.data {
|
if let Some(product) = &q.data {
|
||||||
if let Some(chat_id) = q.chat_id() {
|
|
||||||
bot.send_message(
|
bot.send_message(
|
||||||
chat_id,
|
dialogue.chat_id(),
|
||||||
format!("{full_name}, product '{product}' has been purchased successfully!"),
|
format!("{full_name}, product '{product}' has been purchased successfully!"),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
dialogue.exit().await?;
|
dialogue.exit().await?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue