Optionalparams: {Additional search parameters
OptionaladdOffset?: numberAdditional offset from offset, in resulting messages.
This can be used for advanced use cases, like:
MSGID:
offset = MSGID, addOffset = -20, limit = 20MSGID:
offset = MSGID, addOffset = -10, limit = 20When offset is not set, this will be relative to the last message
OptionalchatId?: InputPeerLikeChat where to search for messages.
When empty, will search across common message box (i.e. private messages and legacy chats)
Optionalfilter?: TypeMessagesFilterFilter the results using some filter (see SearchFilters)
SearchFilters.Empty (i.e. will return all messages)
OptionalfromUser?: InputPeerLikeSearch only for messages sent by a specific user.
You can pass their marked ID, username, phone or "me" or "self"
Optionallimit?: numberLimits the number of messages to be retrieved.
OptionalmaxDate?: number | DateMaximum message date to return
OptionalmaxId?: numberOptionalminDate?: number | DateMinimum message date to return
OptionalminId?: numberMinimum message ID to return
Optionaloffset?: numberOffset ID for the search. Only messages earlier than this ID will be returned.
Optionalquery?: stringText query string. Required for text-only messages, optional for media.
OptionalthreadId?: numberThread ID to return only messages from this thread.
OptionalchunkSize?: numberChunk size, which will be passed as limit parameter
for messages.search. Usually you shouldn't care about this.
Optionallimit?: numberLimits the number of messages to be retrieved.
Search for messages inside a specific chat
Iterable version of searchMessages