Method: messages.searchGlobal

Back to methods index

Global message search


Name Type Description Required
folder_id int Folder ID Optional
q string The query Yes
offset_rate int Offset rate Yes
offset_peer Username, chat ID, Update, Message or InputPeer 0 or the peer offset Optional
offset_id int 0 or the message ID offset Yes
limit int The number of results to return Yes

Return type: messages_Messages

Can bots use this method: NO

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

if (!file_exists('madeline.php')) {
    copy('', 'madeline.php');
include 'madeline.php';

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

$messages_Messages = $MadelineProto->messages->searchGlobal(['folder_id' => int, 'q' => 'string', 'offset_rate' => int, 'offset_peer' => InputPeer, 'offset_id' => int, 'limit' => int, ]);

Or, if you’re into Lua:

messages_Messages = messages.searchGlobal({folder_id=int, q='string', offset_rate=int, offset_peer=InputPeer, offset_id=int, limit=int, })


Code Type Description
400 SEARCH_QUERY_EMPTY The search query is empty
This site uses cookies, as described in the cookie policy. By clicking on "Accept" you consent to the use of cookies.