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

# BotFactory

> Type alias exported by @botmesh/core.

```ts theme={null}
type BotFactory = (provider) => Bot | Promise<Bot>;
```

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

A bot factory: receives the transport provider to use and returns the
configured (not yet started) [Bot](https://botmesh.afaya.com.co/api/core/classes/Bot.md). It may be async (e.g. to load data
before registering handlers). It must pass `provider` to `new Bot({ provider })`
and must NOT call `bot.start()` — the caller (your main block, or `botmesh dev`)
starts it.

## Parameters

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

## Returns

[`Bot`](https://botmesh.afaya.com.co/api/core/classes/Bot) | `Promise`\<[`Bot`](https://botmesh.afaya.com.co/api/core/classes/Bot)>


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