import * as grammyRunner from "https://deno.land/x/grammy_runner@v2.0.3/mod.ts";
Classes
A | |
A decaying deque is a special kind of doubly linked list that serves as a queue for a special kind of nodes, called drifts. |
Functions
Creates an update sink that handles updates in batches. In other words, all updates of one batch are processed concurrently, but one batch has to be done processing before the next batch will be processed. | |
Creates an update sink that handles updates concurrently. In other words, new updates will be fetched—and their processing will be started—before the processing of older updates completes. The maximal number of concurrently handled updates can be limited (default: 500). | |
Creates a runner that pulls in updates from the supplied source, and passes them to the supplied sink. Returns a handle that lets you control the runner, e.g. start it. | |
Creates an update sink that handles updates sequentially, i.e. one after another. No update will be processed before the previous update has not either been processed, or its processing has failed and the error has been handled. | |
Creates an update source based on the given update supplier. | |
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 | |
Creates middleware that distributes updates across cores. | |
f run | Runs a grammY bot with long polling. Updates are processed concurrently with
a default maximum concurrency of 500 updates. Calls to |
Using a runner for grammY allows your bot to run middleware concurrently. This has the benefit that multiple messages can be processed concurrently, hence making your bot drastically more scalable, but it comes at the cost that race conditions may occur because some messages need to be processed in order. |
Interfaces
Options that can be passed to the call to | |
This handle gives you control over a runner. It allows you to stop the bot, start it again, and check whether it is running. | |
Options to be passed to the runner created internally by | |
Options to be passed to | |
Options for creating an update sink. | |
Options controlling how the update source operates. | |
Update consumers are objects that can process an update from the Telegram Bot
API. When you call | |
An update sink is an object that acts as the sink for updates for a runner. It features a handle function that takes in a batch of updates in the form of an array. It returns a promise that should resolve with a positive integral number soon as the sink is ready to handle further updates. The resolved number indicates how many updates the sink is ready to handle next. | |
An update source is an object that acts as the source of updates for a runner. It features an async generator of updates that produces batches of updates in the form of arrays. | |
Update suppliers are objects that can fetch a number of new updates from the
Telegram Bot API. When you call |