telegram api method · layer 229 · #6126a43c

messages.searchGlobal

usable by users

Search for messages and peers globally

definition

messages.searchGlobal#6126a43c flags:# broadcasts_only:flags.1?true groups_only:flags.2?true users_only:flags.3?true folder_id:flags.0?int community:flags.4?InputChannel q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;

parameters

nametypedescription
flags#Flags, see TL conditional fields
broadcasts_onlyflags.1?trueIf set, only returns results from channels (used in the global channel search tab »).
groups_onlyflags.2?trueWhether to search only in groups
users_onlyflags.3?trueWhether to search only in private chats
folder_idflags.0?intPeer folder ID, for more info click here
communityflags.4?InputChannel
qstringQuery
filterMessagesFilterGlobal search filter
min_dateintIf a positive value was specified, the method will return only messages with date bigger than min_date
max_dateintIf a positive value was transferred, the method will return only messages with date smaller than max_date
offset_rateintInitially 0, then set to the next_rate parameter of messages.messagesSlice, or if that is absent, the date of the last returned message.
offset_peerInputPeerOffsets for pagination, for more info click here
offset_idintOffsets for pagination, for more info click here
limitintOffsets for pagination, for more info click here

returns

messages.Messages

errors (5)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400FOLDER_ID_INVALIDInvalid folder ID.
400INPUT_FILTER_INVALIDThe specified filter is invalid.
400SEARCH_QUERY_EMPTYThe search query is empty.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).

history

present in layers 46–229 · constructor id changed 4×

idlayers
#9e3cacb046–99
#0f79c611100–101
#bf7225a4102–118
#4bc6589a119–227
#6126a43c228–229