> ## 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.

# MessageContext<TTools, TRaw>

> Interface exported by @botmesh/core.

Defined in: [core/provider.ts:972](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L972)

The ergonomic context handed to every handler. Generic over `TRaw`. The
reply helpers keep IDENTICAL signatures to v1 — internally each now builds an
`OutboundContent` descriptor and calls `provider.send`, instead of hand-rolling
Baileys JSON. `from`/`sender`/`body`/`type`/`isGroup` are read straight off the
normalized `InboundMessage`, so user code and `keyFor` are unchanged.

## Type Parameters

| Type Parameter | Default type |
| - | - |
|  `TTools` *extends* `object` | [`DefaultTools`](https://botmesh.afaya.com.co/api/core/interfaces/DefaultTools) |
|  `TRaw` | `unknown` |

## Properties

### body

```ts theme={null}
body: string;
```

Defined in: [core/provider.ts:974](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L974)

***

### from

```ts theme={null}
from: string;
```

Defined in: [core/provider.ts:975](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L975)

***

### sender

```ts theme={null}
sender: string;
```

Defined in: [core/provider.ts:976](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L976)

***

### senderInfo

```ts theme={null}
senderInfo: SenderInfo;
```

Defined in: [core/provider.ts:977](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L977)

***

### pushName?

```ts theme={null}
pushName?: string;
```

Defined in: [core/provider.ts:978](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L978)

***

### chat

```ts theme={null}
chat: ChatInfo;
```

Defined in: [core/provider.ts:979](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L979)

***

### type

```ts theme={null}
type: MessageType;
```

Defined in: [core/provider.ts:980](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L980)

***

### isGroup

```ts theme={null}
isGroup: boolean;
```

Defined in: [core/provider.ts:981](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L981)

***

### isPrivate

```ts theme={null}
isPrivate: boolean;
```

Defined in: [core/provider.ts:982](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L982)

***

### isFromMe

```ts theme={null}
isFromMe: boolean;
```

Defined in: [core/provider.ts:983](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L983)

***

### mentions

```ts theme={null}
mentions: string[];
```

Defined in: [core/provider.ts:984](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L984)

***

### quoted?

```ts theme={null}
quoted?: QuotedRef;
```

Defined in: [core/provider.ts:985](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L985)

***

### media?

```ts theme={null}
media?: MediaPayload;
```

Defined in: [core/provider.ts:986](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L986)

***

### sharedLocation?

```ts theme={null}
sharedLocation?: InboundLocation;
```

Defined in: [core/provider.ts:991](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L991)

The location the user shared (`type === 'location'`), normalized by the provider;
`undefined` otherwise. Named `sharedLocation` because `ctx.location()` SENDS one.

***

### ref

```ts theme={null}
ref: MessageRef;
```

Defined in: [core/provider.ts:992](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L992)

***

### raw

```ts theme={null}
raw: TRaw;
```

Defined in: [core/provider.ts:993](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L993)

***

### timestamp

```ts theme={null}
timestamp: number;
```

Defined in: [core/provider.ts:998](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L998)

When the message was sent, in epoch milliseconds (`new Date(ctx.timestamp)` works).
A provider that still reports epoch seconds is converted.

***

### interaction?

```ts theme={null}
interaction?: object;
```

Defined in: [core/provider.ts:1007](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1007)

Present only when this context projects an interaction (Telegram/Discord).
`acknowledge()` is a safe no-op on transports without ack (WhatsApp). On a transport
with `capabilities.interactionsRequireAck` the core acks on its own; once that ack
went out (after the first send or near the deadline), `acknowledge(text)` sends
`text` as a regular reply instead.

#### id

```ts theme={null}
id: string;
```

#### data

```ts theme={null}
data: string;
```

#### respondBy?

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

***

### call?

```ts theme={null}
call?: CallEvent;
```

Defined in: [core/provider.ts:1014](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1014)

Present only on the context the `CALL` trigger receives (`type === 'call'`):
the provider's normalized call notification.

***

### capabilities?

```ts theme={null}
capabilities?: ProviderCapabilities;
```

Defined in: [core/provider.ts:1093](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1093)

Capabilities of the provider this message came from (set on contexts built by a Bot).

***

### textFormat?

```ts theme={null}
textFormat?: TextFormat;
```

Defined in: [core/provider.ts:1099](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1099)

Rich-text dialect of THIS chat: the provider's `textFormatFor(chatId)`, else
`capabilities.textFormat`. Unset = unknown (send Markdown untouched). Use it,
not `capabilities.textFormat`, to format text for the chat (`@botmesh/ai` does).

***

### user

```ts theme={null}
user: UserData;
```

Defined in: [core/provider.ts:1126](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1126)

Persistent profile of the sender (`ctx.sender`), shared across chats — see
[UserData](https://botmesh.afaya.com.co/api/core/interfaces/UserData.md). `ctx.user.ns('game')` scopes it to a namespace.

***

### lang

```ts theme={null}
lang: string;
```

Defined in: [core/provider.ts:1132](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1132)

Resolved language of this message (normalized locale code, e.g. `'es'`, `'en'`).
Order: `ctx.user` preference → provider-reported language → `i18n.detect` → default.

***

### defaultLang?

```ts theme={null}
readonly defaultLang?: string;
```

Defined in: [core/provider.ts:1138](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1138)

The bot's default locale (`lang` / `i18n.defaultLocale`, `'en'` unless configured), whatever
[lang](#lang) resolved to. Plugins that ship their own built-in texts for a few
languages use it as the fallback for a `lang` they do not cover.

***

### langSource?

```ts theme={null}
langSource?: LangSource;
```

Defined in: [core/provider.ts:1145](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1145)

Where [lang](#lang) came from (`'user'` | `'provider'` | `'detector'` | `'default'`);
`undefined` while i18n is off (then `lang` is just the default locale). Plugins
that want a real language signal (e.g. a speech-to-text hint) should ignore
`'default'`. A hook that assigns `ctx.lang` directly does not update it.

***

### tools

```ts theme={null}
tools: TTools;
```

Defined in: [core/provider.ts:1162](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1162)

## Methods

### acknowledge()

```ts theme={null}
acknowledge(text?): Promise<void>;
```

Defined in: [core/provider.ts:1008](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1008)

#### Parameters

| Parameter | Type |
| - | - |
| `text?` | `string` |

#### Returns

`Promise`\<`void`>

***

### ~~say()~~

```ts theme={null}
say(text, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1023](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1023)

Send text to this chat. Same as [MessageContext.reply](#reply).

#### Parameters

| Parameter | Type |
| - | - |
| `text` | `string` |
| `opts?` | [`ReplyOptions`](https://botmesh.afaya.com.co/api/core/interfaces/ReplyOptions) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

#### Deprecated

Use [MessageContext.reply](#reply) (`ctx.reply(text)`). The flow DSL's `.say()` step is not affected.

***

### reply()

```ts theme={null}
reply(text, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1025](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1025)

Send text to this chat (`ctx.from`). The canonical text reply.

#### Parameters

| Parameter | Type |
| - | - |
| `text` | `string` |
| `opts?` | [`ReplyOptions`](https://botmesh.afaya.com.co/api/core/interfaces/ReplyOptions) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### ~~answer()~~

```ts theme={null}
answer(text, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1027](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1027)

#### Parameters

| Parameter | Type |
| - | - |
| `text` | `string` |
| `opts?` | [`ReplyOptions`](https://botmesh.afaya.com.co/api/core/interfaces/ReplyOptions) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

#### Deprecated

Use [MessageContext.reply](#reply) (`ctx.reply(text)`).

***

### ~~text()~~

```ts theme={null}
text(t, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1029](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1029)

#### Parameters

| Parameter | Type |
| - | - |
| `t` | `string` |
| `opts?` | [`ReplyOptions`](https://botmesh.afaya.com.co/api/core/interfaces/ReplyOptions) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

#### Deprecated

Use [MessageContext.reply](#reply) (`ctx.reply(text)`).

***

### photo()

```ts theme={null}
photo(source, caption?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1030](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1030)

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`MediaSource`](https://botmesh.afaya.com.co/api/core/type-aliases/MediaSource) |
| `caption?` | `string` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### video()

```ts theme={null}
video(
   source, 
   caption?, 
   opts?
): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1031](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1031)

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`MediaSource`](https://botmesh.afaya.com.co/api/core/type-aliases/MediaSource) |
| `caption?` | `string` |
| `opts?` | \{ `gifPlayback?`: `boolean`; `ptv?`: `boolean`; } |
| `opts.gifPlayback?` | `boolean` |
| `opts.ptv?` | `boolean` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### audio()

```ts theme={null}
audio(source): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1032](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1032)

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`MediaSource`](https://botmesh.afaya.com.co/api/core/type-aliases/MediaSource) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### voice()

```ts theme={null}
voice(source): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1033](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1033)

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`MediaSource`](https://botmesh.afaya.com.co/api/core/type-aliases/MediaSource) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### file()

```ts theme={null}
file(
   source, 
   filename?, 
   caption?
): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1034](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1034)

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`MediaSource`](https://botmesh.afaya.com.co/api/core/type-aliases/MediaSource) |
| `filename?` | `string` |
| `caption?` | `string` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### sticker()

```ts theme={null}
sticker(source, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1035](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1035)

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`MediaSource`](https://botmesh.afaya.com.co/api/core/type-aliases/MediaSource) |
| `opts?` | \{ `pack?`: `string`; `author?`: `string`; } |
| `opts.pack?` | `string` |
| `opts.author?` | `string` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### location()

```ts theme={null}
location(
   lat, 
   lng, 
   name?
): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1036](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1036)

#### Parameters

| Parameter | Type |
| - | - |
| `lat` | `number` |
| `lng` | `number` |
| `name?` | `string` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### contact()

```ts theme={null}
contact(phone, displayName?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1037](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1037)

#### Parameters

| Parameter | Type |
| - | - |
| `phone` | `string` |
| `displayName?` | `string` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### poll()

```ts theme={null}
poll(
   question, 
   options, 
   multiSelect?
): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1038](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1038)

#### Parameters

| Parameter | Type |
| - | - |
| `question` | `string` |
| `options` | `string`\[] |
| `multiSelect?` | `boolean` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### buttons()

```ts theme={null}
buttons(text, buttons): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1039](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1039)

#### Parameters

| Parameter | Type |
| - | - |
| `text` | `string` |
| `buttons` | [`Button`](https://botmesh.afaya.com.co/api/core/interfaces/Button)\[] |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### react()

```ts theme={null}
react(emoji, target?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1045](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1045)

React to the inbound message (or `target`). On a provider without
`capabilities.reactions` it resolves a `skipped` result instead of rejecting.
An empty `emoji` removes the reaction where the transport supports it.

#### Parameters

| Parameter | Type |
| - | - |
| `emoji` | `string` |
| `target?` | [`MessageRef`](https://botmesh.afaya.com.co/api/core/interfaces/MessageRef) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### quote()

```ts theme={null}
quote(text, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1046](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1046)

#### Parameters

| Parameter | Type |
| - | - |
| `text` | `string` |
| `opts?` | [`ReplyOptions`](https://botmesh.afaya.com.co/api/core/interfaces/ReplyOptions) |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### edit()

#### Call Signature

```ts theme={null}
edit(content, opts?): Promise<EditResult>;
```

Defined in: [core/provider.ts:1056](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1056)

Edit this context's own last reply (`ctx.edit(content)`, only when it has the same
content kind and no `bot.send`/`bot.sendTo` went to the chat since; replies of other
handler runs or other participants' flows are never targeted) or a given one
(`ctx.edit(ref, content)`; a fallback send goes to `ref.chatId`). Native when the provider has `capabilities.edit` and
`editMessage`; otherwise (or when the kind is not editable there) it falls back
to sending a new message — `{ fallback: 'skip' }` sends nothing instead. Edits run
the `before`/`after('send')` hooks (payload `edit: ref`); a hook abort resolves `skipped`.

##### Parameters

| Parameter | Type |
| - | - |
| `content` | `string` \| [`OutboundContent`](https://botmesh.afaya.com.co/api/core/type-aliases/OutboundContent) |
| `opts?` | [`EditOptions`](https://botmesh.afaya.com.co/api/core/interfaces/EditOptions) |

##### Returns

`Promise`\<[`EditResult`](https://botmesh.afaya.com.co/api/core/interfaces/EditResult)>

#### Call Signature

```ts theme={null}
edit(
   ref, 
   content, 
   opts?
): Promise<EditResult>;
```

Defined in: [core/provider.ts:1057](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1057)

##### Parameters

| Parameter | Type |
| - | - |
| `ref` | [`MessageRef`](https://botmesh.afaya.com.co/api/core/interfaces/MessageRef) |
| `content` | `string` \| [`OutboundContent`](https://botmesh.afaya.com.co/api/core/type-aliases/OutboundContent) |
| `opts?` | [`EditOptions`](https://botmesh.afaya.com.co/api/core/interfaces/EditOptions) |

##### Returns

`Promise`\<[`EditResult`](https://botmesh.afaya.com.co/api/core/interfaces/EditResult)>

***

### supports()

```ts theme={null}
supports(feature): MessagingSupport;
```

Defined in: [core/provider.ts:1059](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1059)

How the current provider supports a messaging feature (`native` / `degraded` / `unsupported`).

#### Parameters

| Parameter | Type |
| - | - |
| `feature` | [`MessagingFeature`](https://botmesh.afaya.com.co/api/core/type-aliases/MessagingFeature) |

#### Returns

[`MessagingSupport`](https://botmesh.afaya.com.co/api/core/type-aliases/MessagingSupport)

***

### ~~replyWithTyping()~~

```ts theme={null}
replyWithTyping(text, msPerChar?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1068](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1068)

Show "typing…" for about `msPerChar` ms per character (40 by default, capped at 5 s),
then send `text`. Ignores `BotConfig.typing`.

#### Parameters

| Parameter | Type |
| - | - |
| `text` | `string` |
| `msPerChar?` | `number` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

#### Deprecated

Use `ctx.reply(text, { typing: true })` (or a [TypingConfig](https://botmesh.afaya.com.co/api/core/interfaces/TypingConfig.md) object
such as `{ typing: { charsPerSecond: 25, maxMs: 5000 } }`): it shares the bot-wide
typing policy, refreshes the indicator and is dropped on stop/handoff like every paced reply.

***

### sendNative()

```ts theme={null}
sendNative(provider, payload): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1070](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1070)

Escape hatch for transport-native content (templates, components).

#### Parameters

| Parameter | Type |
| - | - |
| `provider` | `string` |
| `payload` | `unknown` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### stream()

```ts theme={null}
stream(source, opts?): Promise<StreamResult>;
```

Defined in: [core/provider.ts:1077](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1077)

Stream a reply that is still being generated (e.g. LLM tokens) to this chat,
using the best strategy the provider supports (`capabilities.streaming`):
native drafts, throttled edits, or sentence chunks with typing. Long text is
split so no message exceeds `capabilities.maxTextLength`. See `StreamOptions`.

#### Parameters

| Parameter | Type |
| - | - |
| `source` | [`StreamSource`](https://botmesh.afaya.com.co/api/core/type-aliases/StreamSource) |
| `opts?` | [`StreamOptions`](https://botmesh.afaya.com.co/api/core/interfaces/StreamOptions) |

#### Returns

`Promise`\<[`StreamResult`](https://botmesh.afaya.com.co/api/core/interfaces/StreamResult)>

***

### form()?

```ts theme={null}
form?(definition, opts?): Promise<SentMessage<unknown>>;
```

Defined in: [core/provider.ts:1085](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1085)

Send a native form (`OutboundContent` kind `'form'`). Only meaningful when
`capabilities.forms === 'native'`; other providers reject it with
`UnsupportedContentError`. The submission arrives as an inbound message of
type `'form'` (see `parseFormReply()`); `flow().form()` handles all of this.
Set on contexts built by a Bot.

#### Parameters

| Parameter | Type |
| - | - |
| `definition` | [`FormDefinition`](https://botmesh.afaya.com.co/api/core/interfaces/FormDefinition) |
| `opts?` | \{ `token?`: `string`; `nativeId?`: `string`; } |
| `opts.token?` | `string` |
| `opts.nativeId?` | `string` |

#### Returns

`Promise`\<[`SentMessage`](https://botmesh.afaya.com.co/api/core/interfaces/SentMessage)\<`unknown`>>

***

### canRenderForm()?

```ts theme={null}
canRenderForm?(definition, opts?): boolean;
```

Defined in: [core/provider.ts:1091](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1091)

Whether the provider can render `definition` natively right now (see
`IProvider.canRenderForm`). Set on contexts built by a Bot whose provider
implements it; absent = assume yes when `capabilities.forms === 'native'`.

#### Parameters

| Parameter | Type |
| - | - |
| `definition` | [`FormDefinition`](https://botmesh.afaya.com.co/api/core/interfaces/FormDefinition) |
| `opts?` | \{ `nativeId?`: `string`; } |
| `opts.nativeId?` | `string` |

#### Returns

`boolean`

***

### markRead()

```ts theme={null}
markRead(): Promise<void>;
```

Defined in: [core/provider.ts:1102](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1102)

#### Returns

`Promise`\<`void`>

***

### typing()

```ts theme={null}
typing(): Promise<void>;
```

Defined in: [core/provider.ts:1104](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1104)

Show the typing indicator. Best-effort: never rejects (a provider failure is logged at debug).

#### Returns

`Promise`\<`void`>

***

### recording()

```ts theme={null}
recording(): Promise<void>;
```

Defined in: [core/provider.ts:1106](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1106)

Show the recording-audio indicator. Best-effort like [typing](#typing).

#### Returns

`Promise`\<`void`>

***

### delete()

```ts theme={null}
delete(): Promise<void>;
```

Defined in: [core/provider.ts:1107](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1107)

#### Returns

`Promise`\<`void`>

***

### handoff()

```ts theme={null}
handoff(opts?): Promise<boolean>;
```

Defined in: [core/provider.ts:1115](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1115)

Hand this chat (`from`) over to a human: the bot stops routing its messages until
`bot.resume(chatId)`, and any conversation in the chat is cancelled silently.
Resolves `true` if the chat was not already handed off. Safe to call without
awaiting (the state flips synchronously). See `bot.handoff()`.

#### Parameters

| Parameter | Type |
| - | - |
| `opts?` | [`HandoffOptions`](https://botmesh.afaya.com.co/api/core/interfaces/HandoffOptions) |

#### Returns

`Promise`\<`boolean`>

***

### pass()

```ts theme={null}
pass(): void;
```

Defined in: [core/provider.ts:1118](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1118)

#### Returns

`void`

***

### abort()

```ts theme={null}
abort(): void;
```

Defined in: [core/provider.ts:1119](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1119)

#### Returns

`void`

***

### next()?

```ts theme={null}
next?(): Promise<void>;
```

Defined in: [core/provider.ts:1120](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1120)

#### Returns

`Promise`\<`void`>

***

### t()

```ts theme={null}
t(key, params?): string;
```

Defined in: [core/provider.ts:1151](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1151)

Translate `key` (dot path) in [lang](#lang), interpolating `{param}` placeholders;
`params.count` picks plural forms. Missing keys fall back to the default locale,
then to the key itself. See `bot.locale()`.

#### Parameters

| Parameter | Type |
| - | - |
| `key` | `string` |
| `params?` | [`TranslateParams`](https://botmesh.afaya.com.co/api/core/type-aliases/TranslateParams) |

#### Returns

`string`

***

### setLang()

```ts theme={null}
setLang(code): Promise<void>;
```

Defined in: [core/provider.ts:1160](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1160)

Switch the sender's language: persists the registered locale serving `code`
(`'en-GB'` → `'en'` when only `en` exists) to `ctx.user` (key `'lang'` by default)
and updates [lang](#lang) for this message. Rejects with `TypeError` on an empty code
or one no registered locale serves (nothing is stored), with `Error` while i18n is
not enabled (no `bot.locale()` call and no `BotConfig.i18n`), and with
`UserDataError` when the profile cannot be written.

#### Parameters

| Parameter | Type |
| - | - |
| `code` | `string` |

#### Returns

`Promise`\<`void`>


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