Interface SearchMessages

Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. Request type for Tdjson#searchMessages.

interface SearchMessages {
    @type: "searchMessages";
    chat_list: ChatList;
    filter: SearchMessagesFilter;
    limit: number;
    max_date: number;
    min_date: number;
    offset: string;
    only_in_channels?: boolean;
    query: string;
}

Properties

@type: "searchMessages"
chat_list: ChatList

Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported.

Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function.

limit: number

The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

max_date: number

If not 0, the maximum date of the messages to return.

min_date: number

If not 0, the minimum date of the messages to return.

offset: string

Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

only_in_channels?: boolean

Pass true to search only for messages in channels.

query: string

Query to search for.