Optionalparams: {Search parameters
Optionalfilter?: TypeMessagesFilterFilter the results using some filter. (see SearchFilters)
SearchFilters.Empty (i.e. will return all messages)
Optionallimit?: numberLimits the number of messages to be retrieved.
OptionalmaxDate?: number | DateOnly return messages older than this date
OptionalminDate?: number | DateOnly return messages newer than this date
Optionaloffset?: SearchGlobalOffsetOffset data used for pagination
OptionalonlyChannels?: booleanWhether to only search across broadcast channels
Optionalquery?: stringText query string. Use "@" to search for mentions.
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 globally from all of your chats.
Iterable version of searchGlobal
Note: Due to Telegram limitations, you can only get up to ~10000 messages