getHistory
Get chat history. USER-ONLY
Parameters
The identifier of a chat.
offsetId?: number
The identifier of a message. If specified, the chat history will be fetched from that message.
offsetDate?: number
A point in time. If specified, the chat history will be fetched from that date.
addOffset?: number
Additional offset.
limit?: number
The maximum number of results to return. Must be in the range of 1-100. Defaults to 100.
Result
Message[]
Syntax
// Required parameters only.
await client.getHistory(chatId);
// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.getHistory(chatId, {
offsetId,
offsetDate,
addOffset,
limit,
});