getHistory

Get chat history. User-only.

Parameters

chatId: ID

The identifier of the chat to get its history.

fromMessageId?: number

The identifier of a message. If specified, the chat history will be fetched from that message.

limit?: number

The maximum number of results to return. Must be in the range of 1-100. Defaults to 100.

Result

Syntax

// Required parameters only.
await client.getHistory(chatId);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.getHistory(chatId, { fromMessageId, limit });