Skip to content

Message was requested but not provided in a command handler #1019

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

You must be logged in to vote

You need to filter_message before filter_command. so, something like this:

let handler = dptree::entry()
    .branch(Update::filter_callback_query().endpoint(button_handler))
    .branch(
        Update::filter_message()
            .filter_command::<Command>()
            .endpoint(command_handler),
    )
    .branch(Update::filter_message().endpoint(message_handler));

or this:

let handler = dptree::entry()
    .branch(Update::filter_callback_query().endpoint(button_handler))
    .branch(
        Update::filter_message()
            .branch(filter_command::<Command, _>().endpoint(command_handler))
            .endpoint(message_handler)
    );

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@13ros27
Comment options

Answer selected by 13ros27
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