search_global_count()

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().

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

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

    • "empty": Search for all kind of messages (default).

    • "photo": Search for photos.

    • "video": Search for video.

    • "photo_video": Search for either photo or video.

    • "document": Search for documents (generic files).

    • "url": Search for messages containing URLs (web links).

    • "animation": Search for animations (GIFs).

    • "voice_note": Search for voice notes.

    • "audio": Search for audio files (music).

    • "chat_photo": Search for chat photos.

    • "audio_video_note": Search for either audio or video notes.

    • "video_note": Search for video notes.

    • "location": Search for location messages.

    • "contact": Search for contact messages.

Returns

int – On success, the messages count is returned.