Chat.listen()

Chat.listen()[source]

Bound method listen of Chat.

Use as a shortcut for:

await client.listen(chat_id=chat_id)

Example

await chat.listen()
Parameters:
  • filters (Optional[filters.Filter]) – A filter to check if the listener should be fulfilled.

  • listener_type (ListenerTypes) – The type of listener to create. Defaults to hydrogram.types.ListenerTypes.MESSAGE.

  • timeout (Optional[int]) – The maximum amount of time to wait for the listener to be fulfilled. Defaults to None.

  • unallowed_click_alert (bool) – Whether to alert the user if they click on a button that is not intended for them. Defaults to True.

  • user_id (Optional[Union[int, str], List[Union[int, str]]]) – The user ID(s) to listen for. Defaults to None.

  • message_id (Optional[Union[int, List[int]]]) – The message ID(s) to listen for. Defaults to None.

  • inline_message_id (Optional[Union[str, List[str]]]) – The inline message ID(s) to listen for. Defaults to None.

Returns:

Union[Message, CallbackQuery] – The Message or CallbackQuery