mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-22 06:45:37 +01:00
Simplify examples/purchase.rs
by sharing filters
This commit is contained in:
parent
bc0e9b19a4
commit
a514c845cb
1 changed files with 4 additions and 4 deletions
|
@ -56,16 +56,16 @@ async fn main() {
|
||||||
dialogue::enter::<Update, InMemStorage<State>, State, _>()
|
dialogue::enter::<Update, InMemStorage<State>, State, _>()
|
||||||
.branch(
|
.branch(
|
||||||
Update::filter_message()
|
Update::filter_message()
|
||||||
.chain(teloxide::handler![State::ReceiveFullName].endpoint(receive_full_name)),
|
.branch(teloxide::handler![State::ReceiveFullName].endpoint(receive_full_name))
|
||||||
|
.branch(dptree::entry().filter_command::<Command>().endpoint(handle_command))
|
||||||
|
.branch(dptree::endpoint(invalid_state)),
|
||||||
)
|
)
|
||||||
.branch(
|
.branch(
|
||||||
Update::filter_callback_query().chain(
|
Update::filter_callback_query().chain(
|
||||||
teloxide::handler![State::ReceiveProductChoice { full_name }]
|
teloxide::handler![State::ReceiveProductChoice { full_name }]
|
||||||
.endpoint(receive_product_selection),
|
.endpoint(receive_product_selection),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
.branch(Update::filter_message().filter_command::<Command>().endpoint(handle_command))
|
|
||||||
.branch(Update::filter_message().endpoint(invalid_state)),
|
|
||||||
)
|
)
|
||||||
.dependencies(dptree::deps![InMemStorage::<State>::new()])
|
.dependencies(dptree::deps![InMemStorage::<State>::new()])
|
||||||
.build()
|
.build()
|
||||||
|
|
Loading…
Add table
Reference in a new issue