MadelineProtoDocs/docs/API_docs/methods/messages.searchGlobal.md
2024-05-01 14:53:46 +02:00

2.6 KiB

title description grand_parent parent image redirect_from
messages.searchGlobal Search for messages and peers globally Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_searchGlobal.html

Method: messages.searchGlobal

Back to methods index

Search for messages and peers globally

Parameters:

Name Type Description Required
broadcasts_only Bool Optional
folder_id int Peer folder ID, for more info click here Optional
q string Query Optional
filter MessagesFilter Global search filter Optional
min_date int If a positive value was specified, the method will return only messages with date bigger than min_date Optional
max_date int If a positive value was transferred, the method will return only messages with date smaller than max_date Optional
offset_rate int Initially 0, then set to the next_rate parameter of messages.messagesSlice Optional
offset_peer Username, chat ID, Update, Message or InputPeer Offsets for pagination, for more info click here Optional
offset_id int Offsets for pagination, for more info click here Optional
limit int Offsets for pagination, for more info click here Optional

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(broadcasts_only: $Bool, folder_id: $int, q: 'string', filter: $MessagesFilter, min_date: $int, max_date: $int, offset_rate: $int, offset_peer: $InputPeer, offset_id: $int, limit: $int, );