From ae48a11b3fdeee25f31574eff3db9377c99a6939 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Sun, 24 Apr 2022 23:11:47 +0600 Subject: [PATCH] Use `dialogue.chat_id()` in `examples/purchase.rs` --- examples/purchase.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/purchase.rs b/examples/purchase.rs index 6f4af6af..50201fec 100644 --- a/examples/purchase.rs +++ b/examples/purchase.rs @@ -13,7 +13,7 @@ // ``` use teloxide::{ - dispatching::dialogue::{self, GetChatId, InMemStorage}, + dispatching::dialogue::{self, InMemStorage}, prelude::*, types::{InlineKeyboardButton, InlineKeyboardMarkup}, utils::command::BotCommands, @@ -124,14 +124,12 @@ async fn receive_product_selection( full_name: String, ) -> HandlerResult { if let Some(product) = &q.data { - if let Some(chat_id) = q.chat_id() { - bot.send_message( - chat_id, - format!("{full_name}, product '{product}' has been purchased successfully!"), - ) - .await?; - dialogue.exit().await?; - } + bot.send_message( + dialogue.chat_id(), + format!("{full_name}, product '{product}' has been purchased successfully!"), + ) + .await?; + dialogue.exit().await?; } Ok(())