MadelineProtoDocs/old_docs/API_docs_v42/methods/messages_searchGlobal.md
2019-09-02 17:41:28 +02:00

1.6 KiB

title description image
messages.searchGlobal Global message search https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png

Method: messages.searchGlobal

Back to methods index

Global message search

Parameters:

Name Type Description Required
q string The query Yes
offset_date int 0 or the date offset 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('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

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

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

Or, if you're into Lua:

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

Errors

Code Type Description
400 SEARCH_QUERY_EMPTY The search query is empty