From 4ad7dfac49f7888262a03892b271ccdbb9e85838 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Mon, 25 Apr 2022 01:46:03 +0600 Subject: [PATCH] Update the docs of `teloxide::handler!` --- src/dispatching/dialogue/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dispatching/dialogue/mod.rs b/src/dispatching/dialogue/mod.rs index 98f2887d..c558d991 100644 --- a/src/dispatching/dialogue/mod.rs +++ b/src/dispatching/dialogue/mod.rs @@ -214,11 +214,13 @@ where })) } -/// Perform a dialogue FSM transition. +/// Filters an enumeration, passing its payload forwards. /// -/// This macro expands to a [`dptree::Handler`] that filters your dialogue -/// state: if the state enumeration is of a certain variant, the execution -/// continues; otherwise, `dptree` will try the next branch. +/// This macro expands to a [`dptree::Handler`] that acts on your enumeration +/// type: if the enumeration is of a certain variant, the execution continues; +/// otherwise, `dptree` will try the next branch. This is very useful for +/// dialogue FSM transitions and Telegram command filtering; for a complete +/// example, please see [`examples/purchase.rs`]. /// /// Variants can take the following forms: /// @@ -243,6 +245,8 @@ where /// ## Dependency requirements /// /// - Your dialogue state enumeration `State`. +/// +/// [`examples/purchase.rs`]: https://github.com/teloxide/teloxide/blob/master/examples/purchase.rs #[macro_export] macro_rules! handler { ($($variant:ident)::+) => {