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.
Search for messages globally from all of your chats
Note: Due to Telegram limitations, you can only get up to ~10000 messages