Package it.ernytech.tdlib

## Class TdApi.GetChatHistory

- java.lang.Object
- - it.ernytech.tdlib.TdApi.Object
  - - it.ernytech.tdlib.TdApi.Function
    - - it.ernytech.tdlib.TdApi.GetChatHistory

Enclosing class:
  TdApi

    public static class TdApi.GetChatHistory
    extends TdApi.Function

Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing messageId). For optimal performance the number of returned messages is chosen by the library. This is an offline request if onlyLocal is true.

Returns `Messages`

### Field Summary

Fields
`long` `chatId` Chat identifier.
`static int` `CONSTRUCTOR` Identifier uniquely determining type of the object.
`long` `fromMessageId` Identifier of the message starting from which history must be fetched; use 0 to get results from the beginning (i.e., from oldest to newest).
`int` `limit` The maximum number of messages to be returned; must be positive and can't be greater than 100.
`int` `offset` Specify 0 to get results from exactly the fromMessageId or a negative offset to get the specified message and some newer messages.
`boolean` `onlyLocal` If true, returns only messages that are available locally without sending network requests.

### Constructor Summary

Constructors
`GetChatHistory()` Default constructor.
`GetChatHistory​(long chatId, long fromMessageId, int offset, int limit, boolean onlyLocal)` Constructor for initialization of all fields.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getConstructor()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from class it.ernytech.tdlib.TdApi.Function

`toString`

### Field Detail

#### chatId

    public long chatId

Chat identifier.

#### fromMessageId

    public long fromMessageId

Identifier of the message starting from which history must be fetched; use 0 to get results from the beginning (i.e., from oldest to newest).

#### offset

    public int offset

Specify 0 to get results from exactly the fromMessageId or a negative offset to get the specified message and some newer messages.

#### limit

    public int limit

The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.

#### onlyLocal

    public boolean onlyLocal

If true, returns only messages that are available locally without sending network requests.

#### CONSTRUCTOR

    public static final int CONSTRUCTOR

Identifier uniquely determining type of the object.

See Also:
  Constant Field Values

### Constructor Detail

#### GetChatHistory

    public GetChatHistory()

Default constructor.

#### GetChatHistory

    public GetChatHistory​(long chatId,
                          long fromMessageId,
                          int offset,
                          int limit,
                          boolean onlyLocal)

Constructor for initialization of all fields.

Parameters:
  `chatId` - Chat identifier.
  `fromMessageId` - Identifier of the message starting from which history must be fetched; use 0 to get results from the beginning (i.e., from oldest to newest).
  `offset` - Specify 0 to get results from exactly the fromMessageId or a negative offset to get the specified message and some newer messages.
  `limit` - The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.
  `onlyLocal` - If true, returns only messages that are available locally without sending network requests.

### Method Detail

#### getConstructor

    public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`
Returns:
  this.CONSTRUCTOR