Skip to main content
Defined in: ops/broadcast.ts:35 Options of bot.broadcast(): batching, pacing, retries on rate limits, progress callbacks and cancellation.

Properties

batchSize?

Defined in: ops/broadcast.ts:37 Chats per batch (default 10).

delayBetween?

Defined in: ops/broadcast.ts:39 Pause between batches: ms or a duration string ('2s', '1m'). Default 0.

concurrency?

Defined in: ops/broadcast.ts:41 Parallel sends inside a batch (default 1 — strictly sequential).

retries?

Defined in: ops/broadcast.ts:46 Retries per chat AFTER the first attempt, on a RateLimitedError (default 3, so up to 4 sends). Other errors are not retried. Same meaning as every retries option.

maxRetries?

Defined in: ops/broadcast.ts:48

Deprecated

Use retries (same meaning).

sendOptions?

Defined in: ops/broadcast.ts:50 Options forwarded to every send (quoted, mentions, …).

onProgress?

Defined in: ops/broadcast.ts:52 Called after each chat settles: (done, total, last). Errors thrown here are reported, never fatal.

Parameters

Returns

void

onFail?

Defined in: ops/broadcast.ts:54 Called for each chat that finally failed. Errors thrown here are reported, never fatal.

Parameters

Returns

void

signal?

Defined in: ops/broadcast.ts:56 Abort to stop: no new send starts; in-flight sends finish; the rest land in pending.