Skip to main content
Latest
interface SourceOptions
Re-export
import { type SourceOptions } from "https://deno.land/x/grammy_runner@v2.0.3/mod.ts";

Options controlling how the update source operates.

Properties

optional
speedTrafficBalance: number

By default, the runner tries to pull in updates as fast as possible. This means that the bot keeps the response times as short as possible. In other words, the runner optimizes for high speed.

However, a consequence of this is that the runner fetches many small update batches from Telegram. This can increase the network traffic substantially.

You can use this option to decide on a scale from 0.0 to 1.0 (both inclusive) if the runner should optimize for high speed or for low network traffic. Specify 0.0 to fetch updates as fast as possible. Specify 1.0 to fetch updates as efficiently as possible.

Defaults to 0.0.

optional
maxDelayMilliseconds: number

Defines a hard limit for the duration that the runner waits between calls to getUpdates.

Note that by default, the runner does not wait at all between these calls. This is because if the speed traffic balance is set to 0.0 (which is also the default), the next update is always fetched immediately after the previous one is received.

Defaults to 500 milliseconds.