Skip to content

Commit

Permalink
Merge commit '2de5c76538ba3b32fd03840cc965cb763ad934d3' into docs/quick
Browse files Browse the repository at this point in the history
  • Loading branch information
leifermendez committed Sep 5, 2024
2 parents 6f97cfe + 2de5c76 commit 2a8ab67
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/en/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const sections = [
This is a __free__ and open source framework with an intuitive and extensible way to create chatbot and smart apps that connect to different communication channels like __[Whatsapp](/plugins/telegram)__, __[Telegram](/plugins/telegram)__ and others.
We have made an intuitive framework so you can have your first chatbot in minutes.

[![BuilderBot Framework](assets/awards.webp)](https://a.cstmapp.com/voteme/974264/712365893)
<a href="https://a.cstmapp.com/voteme/974264/712365893" target="_blank"><img src="assets/awards.webp" alt="BuilderBot Framework" class="rounded-lg" /></a>


## Quick Start
Expand All @@ -41,6 +41,16 @@ npm create builderbot@latest
</div>


<div className="not-prose aling-block">
<Button
href="/quickstart#install"
variant="text"
arrow="right"
children="Installation and requirements"
/>
</div>


---

## ⚡ Building an AI bot
Expand Down
52 changes: 52 additions & 0 deletions src/pages/en/uses-cases/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ export const description =

Below you will find different examples showing the implementation in different use cases. These examples have been compiled based on the community, feel free to post an example that you like or that you think would be useful for new people.

---

## How to Update to the Latest Version

To ensure you're using the most up-to-date features and bug fixes, it's important to keep your BuilderBot installation current. Follow the steps below to update to the latest version.
To keep your project up to date, make sure to run the command to update the core and the corresponding provider

<CodeGroup>
```bash {{ title: 'core' }}
pnpm install @builderbot/bot@latest
pnpm install @builderbot/provider-baileys@latest
pnpm install @builderbot/provider-wppconnect@latest
pnpm install @builderbot/provider-venom@latest
pnpm install @builderbot/provider-meta@latest
pnpm install @builderbot/provider-twilio@latest
```

</CodeGroup>


---

## My first bot
Expand Down Expand Up @@ -273,6 +293,38 @@ const flow = addKeyword<BaileysProvider>('botoff')

---

## Bot Self-Interaction {{ tag: 'state' }}

In certain scenarios, it is necessary for the bot's phone number (host) to be able to interact within logical flows. To achieve this, we have several configurable options:
- **host:** This is used when you want the bot to be able to respond to messages in the same chat with itself. For example, if the bot's number is 0000, it will be able to send and receive messages to/from 0000.
- **both:** This option allows both the bot and you (the developer/administrator) to intervene in the chat of a person interacting with the bot.
- **none:** (default option) Only allows interaction between the user and the bot, without intervention from the host number.

```ts {{ title: 'app.ts' }}
import { createBot, createProvider, createFlow, addKeyword, MemoryDB } from '@builderbot/bot'
import { BaileysProvider } from '@builderbot/provider-baileys'

const main = async () => {
const adapterDB = new MemoryDB()
const adapterFlow = createFlow([...])
const adapterProvider = createProvider(BaileysProvider, {
writeMyself: 'host' as 'none' | 'host' | 'both'
})

adapterProvider.initHttpServer(3000)

await createBot({
flow: adapterFlow,
provider: adapterProvider,
database: adapterDB,
})
}

main()
```

---

<Guides />

<Resources />
Expand Down

0 comments on commit 2a8ab67

Please sign in to comment.