Skip to content

How can I use a dptree on a CallbackQuery handler? #964

Answered by WaffleLapkin
Enucatl asked this question in Q&A
Discussion options

You must be logged in to vote

You can use filter_map with FeedCommand::parse the same way you do filter_command. So something like

Update::filter_callback_query()
    .filter_map(|q: CallbackQuery| q.data.and_then(FeedCommand::parse))
    .branch(case![FeedCommand::Delete { feed_id }].endpoint(delete))
    .branch(case![FeedCommand::Exit].endpoint(delete))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Enucatl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants