UpdateSupplier
Update suppliers are objects that can fetch a number of new updates from the Telegram Bot API. When you call run(bot)
, such an object will be created automatically for you. It uses the passed bot to fetch updates.
If you want to poll updates from a different source, such as a message queue, you can construct your own update source by passing a custom update supplier.
Properties
supply
ts
supply: (batchSize: number, signal: AbortSignal) => Promise<Y[]>;
Requests the next batch of updates of the specified size and returns them as an array. The request should respect the given Abort
. If the signal is raised, the currently pending request must be cancelled.