> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# BroadcastOptions

> Interface exported by @botmesh/core.

Defined in: [ops/broadcast.ts:35](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L35)

Options of `bot.broadcast()`: batching, pacing, retries on rate limits, progress
callbacks and cancellation.

## Properties

### batchSize?

```ts theme={null}
batchSize?: number;
```

Defined in: [ops/broadcast.ts:37](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L37)

Chats per batch (default 10).

***

### delayBetween?

```ts theme={null}
delayBetween?: string | number;
```

Defined in: [ops/broadcast.ts:39](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L39)

Pause between batches: ms or a duration string (`'2s'`, `'1m'`). Default 0.

***

### concurrency?

```ts theme={null}
concurrency?: number;
```

Defined in: [ops/broadcast.ts:41](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L41)

Parallel sends inside a batch (default 1 — strictly sequential).

***

### retries?

```ts theme={null}
retries?: number;
```

Defined in: [ops/broadcast.ts:46](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L46)

Retries per chat AFTER the first attempt, on a [RateLimitedError](https://botmesh.afaya.com.co/api/core/classes/RateLimitedError.md) (default 3, so up
to 4 sends). Other errors are not retried. Same meaning as every `retries` option.

***

### ~~maxRetries?~~

```ts theme={null}
maxRetries?: number;
```

Defined in: [ops/broadcast.ts:48](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L48)

#### Deprecated

Use [retries](#retries) (same meaning).

***

### sendOptions?

```ts theme={null}
sendOptions?: SendOptions;
```

Defined in: [ops/broadcast.ts:50](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L50)

Options forwarded to every send (`quoted`, `mentions`, …).

***

### onProgress?

```ts theme={null}
onProgress?: (done, total, last) => void;
```

Defined in: [ops/broadcast.ts:52](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L52)

Called after each chat settles: `(done, total, last)`. Errors thrown here are reported, never fatal.

#### Parameters

| Parameter | Type |
| - | - |
| `done` | `number` |
| `total` | `number` |
| `last` | [`BroadcastProgress`](https://botmesh.afaya.com.co/api/core/interfaces/BroadcastProgress) |

#### Returns

`void`

***

### onFail?

```ts theme={null}
onFail?: (chatId, error) => void;
```

Defined in: [ops/broadcast.ts:54](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L54)

Called for each chat that finally failed. Errors thrown here are reported, never fatal.

#### Parameters

| Parameter | Type |
| - | - |
| `chatId` | `string` |
| `error` | `Error` |

#### Returns

`void`

***

### signal?

```ts theme={null}
signal?: AbortSignal;
```

Defined in: [ops/broadcast.ts:56](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/broadcast.ts#L56)

Abort to stop: no new send starts; in-flight sends finish; the rest land in `pending`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.