Skip to main content
Latest
function createUpdateFetcher
import { createUpdateFetcher } from "https://deno.land/x/grammy_runner@v2.0.3/mod.ts";

Takes a grammY bot and returns an update fetcher function for it. The returned function has built-in retrying behavior that can be configured. After every successful fetching operation, the offset parameter is correctly incremented. As a result, you can simply invoke the created function multiple times in a row, and you will obtain new updates every time.

The update fetcher function has a default long polling timeout of 30 seconds. Specify sourceOptions to configure what values to pass to getUpdates calls.

Type Parameters

Y extends { update_id: number; }
R

Parameters

bot: BotAdapter<Y, R>

A grammY bot

optional
options: RunnerOptions = [UNSUPPORTED]

Further options on how to fetch updates