Skip to content

searchSecretMessages

Sahri Riza Umami edited this page Jul 1, 2018 · 4 revisions

Searches for messages in secret chats.
Returns the results in reverse chronological order.
For optimal performance the number of returned messages is chosen by the library.

searchSecretMessages(chat_id, query, from_search_id, limit, filter, callback, data)
Field Type Description
chat_id int53 Identifier of the chat in which to search. Specify 0 to search in all secret chats.
query string Query to search for. If empty, searchChatMessages should be used instead.
from_search_id int64 The identifier from the result of a previous request, use 0 to get results from the beginning.
limit int32 Maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.
filter SearchMessagesFilter A filter for the content of messages in the search results: : Empty, Animation, Audio, Document, Photo, Video, VoiceNote, PhotoAndVideo, Url, ChatPhoto, Call, MissedCall, VideoNote, VoiceAndVideoNote, Mention or UnreadMention.

Example

  • Searches for messages contain string 'tandain' in secret chats.

    searchSecretMessages(0, 'tandain')

    Response:

    {
      ["@type"] = "foundMessages",
      messages = {},
      next_from_search_id = "1"
    }

Frequently Asked Questions
The Functions

Clone this wiki locally