From aade493391f5ad85e0ac04d529dc8fac37d9a721 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Sat, 5 Feb 2022 00:26:40 +0600 Subject: [PATCH] Update the docs of `dialogue/mod.rs` --- src/dispatching2/dialogue/mod.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/dispatching2/dialogue/mod.rs b/src/dispatching2/dialogue/mod.rs index 7f2c1e08..012be2bd 100644 --- a/src/dispatching2/dialogue/mod.rs +++ b/src/dispatching2/dialogue/mod.rs @@ -40,18 +40,13 @@ //! dialogue: MyDialogue, //! (full_name,): (String,), // Available from `State::ReceiveAge`. //! ) -> anyhow::Result<()> { -//! match msg.text() { -//! Some(number) => match number.parse::() { -//! Ok(age) => { -//! bot.send_message(msg.chat.id, "What's your location?").await?; -//! dialogue.update(State::ReceiveLocation { full_name, age }).await?; -//! } -//! _ => { -//! bot.send_message(msg.chat.id, "Send me a number.").await?; -//! } -//! }, -//! None => { -//! bot.send_message(msg.chat.id, "Send me a text message.").await?; +//! match msg.text().map(|text| text.parse::()) { +//! Some(Ok(age)) => { +//! bot.send_message(msg.chat.id, "What's your location?").await?; +//! dialogue.update(State::ReceiveLocation { full_name, age }).await?; +//! } +//! _ => { +//! bot.send_message(msg.chat.id, "Send me a number.").await?; //! } //! } //!