register_next_step_handler()

Client.register_next_step_handler()

Registers a listener with a callback to be called when the listener is fulfilled.

Usable by Users Bots
Parameters:
  • callback (``Callable``) – The callback to call when the listener is fulfilled.

  • chat_id (``int`` | ``str`` | Iterable of ``int`` | Iterable of ``str``, *optional*) – The chat ID to listen for.

  • user_id (``int`` | ``str`` | Iterable of ``int`` | Iterable of ``str``, *optional*) – The user ID to listen for.

  • filters (:obj:`~pyrogram.filters`, *optional*) – A filter to check the incoming message against.

  • listener_type (:obj:`~pyrogram.enums.ListenerTypes`, *optional*) – The type of listener to listen for. Default to Message.

  • unallowed_click_alert (``bool``, *optional*) – Whether to alert the user if they click a button that doesn’t match the filters. Default to True.

  • message_id (``int``, *optional*) – The message ID to listen for.

  • inline_message_id (``str``, *optional*) – The inline message ID to listen for.