Skip to content

Allow raise ApplicationHandlerStop to jum to next certain handlers group or skip particular groups. #4836

@david-shiko

Description

@david-shiko

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

Example:
We have 3 groups of handlers and each group has single handler, every handler matching the same update, i.e our update will be handled in the 3 handlers totally.
The problem: What if we eant to skip group 2 in certain cases, i.e. update need to be handled only by handler in group 1 and handler in group 3.

My case:
I have restart command which should trigger before any other groups of handlers, but I still want this command to be logged by the logs_handlers in the last group, i.e. we have 3 groups: {-1: restart_cmd, 0 - core_app_commands, 1 - auto_logger}.

Describe the solution you'd like

Add optional parameter next_group to the ApplicationHandlerStop()

Describe alternatives you've considered

Add similar exception, something like ApplicationHandlerSkip( here groups rapameter required ) or ApplicationHandlerJump( here groups rapameter required )

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions