Start here · Introduction

Edit this page on GitHub

Get started with BuilderBot

Esta é uma estrutura free e de código aberto com uma maneira intuitiva e extensível de criar chatbot e aplicativos inteligentes que se conectam a diferentes canais de comunicação, como Whatsapp, Telegram e outros. Criamos uma estrutura intuitiva para que você possa ter seu primeiro chatbot em minutos.

User · WhatsApphello
FlowaddKeyword(['hello', 'hi'])
BotEy! welcome
ProviderBaileysDatabaseMemoryDBHTTP:3000

Quick Start

Para instalar rapidamente com o seguinte comando

pnpm create builderbot@latest

Quick Example

Neste exemplo, podemos ver a base de um bot simples que responde às palavras-chave enviadas por um usuário, as palavras são: info, hello, hi. Você pode ver como criar o bot e implementar o flows.

import { createBot, createProvider, createFlow, addKeyword, MemoryDB } from '@builderbot/bot'
import { BaileysProvider } from '@builderbot/provider-baileys'

const welcomeFlow = addKeyword<BaileysProvider, MemoryDB>(['hello', 'hi']).addAnswer('Ey! welcome')

const main = async () => {

    const adapterDB = new MemoryDB()
    const adapterFlow = createFlow([welcomeFlow])
    const adapterProvider = createProvider(BaileysProvider)

    const { handleCtx, httpServer } = await createBot({
        flow: adapterFlow,
        provider: adapterProvider,
        database: adapterDB,
    })

    httpServer(3000)

    adapterProvider.server.post('/v1/messages', handleCtx(async (bot, req, res) => {
        const { number, message } = req.body
        await bot.sendMessage(number, message, {})
        return res.end('send')
    }))
}

main()
Result · ChathiEy! welcomeImage sent from URL in the exampleSend image from URL
Result · HTTPPOST:3000/v1/messagesBody with number and message. The bot sends the message and answers send.

Guides

My first chatbot

Learn how build your first chatbot in few minutes

Read more

Concepts

Understand the essential concepts for building bots

Read more

Add Functions

The key to learning how to write flows is add-functions.

Read more

Plugins

Unlimitate and start implementing the community plugins.

Read more

Resources

Modularize

Learn how to modularise flows so that you can have a more maintainable bot.

Send Message

How to send a message via HTTP to start conversations, you can send multimedia as well.

Dockerizer

A good practice is to dockerise your bots to make them more maintainable and effective.

Events

Learning about events will make us more fluent when creating chatbots.