search_global_count()

async Client.search_global_count()

Get the count of messages resulting from a global search.

If you want to get the actual messages, see search_global().

Usable by Users Bots
Parameters:
  • query (str, optional) – Text query string. Use “@” to search for mentions.

  • filter (MessagesFilter, optional) – Pass a filter in order to search for specific kind of messages only:

  • community (int | str, optional) – Unique identifier (int) or username (str) of the community to search in.

  • broadcasts_only (bool, optional) – Pass True to search channels only.

  • groups_only (bool, optional) – Pass True to search groups only.

  • users_only (bool, optional) – Pass True to search private chats only.

  • folder_id (int) – Unique identifier (int) of the target folder.

Returns:

int – On success, the messages count is returned.