Link Search Menu Expand Document

Method: messages.getSearchResultsPositions

Back to methods index

Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation.

Returns the results in reverse chronological order (i.e., in order of decreasing message_id).

Parameters:

NameTypeDescriptionRequired
peerUsername, chat ID, Update, Message or InputPeerPeer where to searchOptional
filterMessagesFilterMessage filter, inputMessagesFilterEmpty, inputMessagesFilterMyMentions filters are not supported by this method.Optional
offset_idintOffsets for pagination, for more info click hereYes
limitintMaximum number of results to return, see paginationYes

Return type: messages.SearchResultsPositions

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

// PHP 8+ syntax, use an array on PHP 7.
$messages_SearchResultsPositions = $MadelineProto->messages->getSearchResultsPositions(peer: InputPeer, filter: MessagesFilter, offset_id: int, limit: int, );