SourceOptions
Options controlling how the update source operates.
Properties
speedTrafficBalance
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
to 1
(both inclusive) if the runner should optimize for high speed or for low network traffic. Specify 0
to fetch updates as fast as possible. Specify 1
to fetch updates as efficiently as possible.
Defaults to 0
.
maxDelayMilliseconds
maxDelayMilliseconds?: number;
Defines a hard limit for the duration that the runner waits between calls to get
.
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
(which is also the default), the next update is always fetched immediately after the previous one is received.
Defaults to 500 milliseconds.