INNER CODE UNIT · TypeScript
timeout
grammyjs/grammY · src/bot.ts:547
const timeout = options?.timeout ?? 30; // seconds
let allowed_updates: PollingOptions["allowed_updates"] =
options?.allowed_updates ?? []; // reset to default if unspecified
try {
while (this.pollingRunning) {
// fetch updates
const updates = await this.fetchUpdates(
{ limit, timeout, allowed_updates },
);
// check if polling stopped
if (updates === undefined) break;
// handle updates
await this.handleUpdates(updates);
// Telegram uses the last setting if `allowed_updates` is omitted so
// we can save some traffic by only sending it in the first request
allowed_updates = undefined;
}