Get started with BuilderBot
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, Telegram and others. We have made an intuitive framework so you can have your first chatbot in minutes. Winner of the first prize at OpenExpo 2024 🏆
Quick Start
To create quickly with the following command
pnpm create builderbot@latest
⚡ Building an AI bot
In this few minutes tutorial you can have your own chatbot with whatsapp and artificial intelligence to talk about your business.
Learn how to create a bot with the new open ai assistants
Quick Example
In this example we can see the basis of a simple bot which responds to the keywords sent by a user, the words are: info, hello, hi
. You can see how to create the bot and implement the 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')
.addAnswer(`Send image from URL`, { media: 'https://i.imgur.com/0HpzsEm.png' })
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()