Class TdApi.SearchMessages

  • Enclosing class:
    TdApi

    public static class TdApi.SearchMessages
    extends TdApi.Function
    Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chatId, messageId)). For optimal performance the number of returned messages is chosen by the library.

    Returns Messages

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CONSTRUCTOR
      Identifier uniquely determining type of the object.
      int limit
      The maximum number of messages to be returned, up to 100.
      long offsetChatId
      The chat identifier of the last found message, or 0 for the first request.
      int offsetDate
      The date of the message starting from which the results should be fetched.
      long offsetMessageId
      The message identifier of the last found message, or 0 for the first request.
      java.lang.String query
      Query to search for.
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchMessages()
      Default constructor.
      SearchMessages​(java.lang.String query, int offsetDate, long offsetChatId, long offsetMessageId, int limit)
      Constructor for initialization of all fields.
    • Field Detail

      • query

        public java.lang.String query
        Query to search for.
      • offsetDate

        public int offsetDate
        The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the beginning.
      • offsetChatId

        public long offsetChatId
        The chat identifier of the last found message, or 0 for the first request.
      • offsetMessageId

        public long offsetMessageId
        The message identifier of the last found message, or 0 for the first request.
      • limit

        public int limit
        The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.
      • CONSTRUCTOR

        public static final int CONSTRUCTOR
        Identifier uniquely determining type of the object.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SearchMessages

        public SearchMessages()
        Default constructor.
      • SearchMessages

        public SearchMessages​(java.lang.String query,
                              int offsetDate,
                              long offsetChatId,
                              long offsetMessageId,
                              int limit)
        Constructor for initialization of all fields.
        Parameters:
        query - Query to search for.
        offsetDate - The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the beginning.
        offsetChatId - The chat identifier of the last found message, or 0 for the first request.
        offsetMessageId - The message identifier of the last found message, or 0 for the first request.
        limit - The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.