method ApiMethods.getUpdates
ApiMethods.getUpdates(args?: { offset?: number; limit?: number; timeout?: number; allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>; }): Update[]

Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.

Notes

  1. This method will not work if an outgoing webhook is set up.
  2. In order to avoid getting duplicate updates, recalculate offset after each server response.

Parameters

optional
args: { offset?: number; limit?: number; timeout?: number; allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>; }

Return Type

Usage

import { type ApiMethods } from "types";