ApplicationHandlerStop

class telegram.ext.ApplicationHandlerStop(state=None)[source]

Bases: Exception

Raise this in a handler or an error handler to prevent execution of any other handler (even in different groups).

In order to use this exception in a telegram.ext.ConversationHandler, pass the optional state parameter instead of returning the next state:

async def conversation_callback(update, context):
    ...
    raise ApplicationHandlerStop(next_state)

Note

Has no effect, if the handler or error handler is run in a non-blocking way.

Parameters:

state (object, optional) – The next state of the conversation.

state[source]

Optional. The next state of the conversation.

Type:

object