• 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

    Parameters

    • client: ITelegramClient
    • Optionalparams: {
          filter?: TypeMessagesFilter;
          limit?: number;
          maxDate?: number | Date;
          minDate?: number | Date;
          offset?: SearchGlobalOffset;
          onlyChannels?: boolean;
          query?: string;
      } & { chunkSize?: number; limit?: number }

      Search parameters

      • Optionalfilter?: TypeMessagesFilter

        Filter the results using some filter. (see SearchFilters)

        SearchFilters.Empty (i.e. will return all messages)

      • Optionallimit?: number

        Limits the number of messages to be retrieved.

        100
        
      • OptionalmaxDate?: number | Date

        Only return messages older than this date

      • OptionalminDate?: number | Date

        Only return messages newer than this date

      • Optionaloffset?: SearchGlobalOffset

        Offset data used for pagination

      • OptionalonlyChannels?: boolean

        Whether to only search across broadcast channels

      • Optionalquery?: string

        Text query string. Use "@" to search for mentions.

        "" (empty string)

      • OptionalchunkSize?: number

        Chunk size, which will be passed as limit parameter for messages.search. Usually you shouldn't care about this.

        100
        
      • Optionallimit?: number

        Limits the number of messages to be retrieved.

        Infinity, i.e. all messages are returned

    Returns AsyncIterableIterator<Message>