Start here · Introduction
Edit this page on GitHubGet 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.
1ST PRIZEWinner of the first prize at OpenExpo 2024addKeyword(['hello', 'hi'])Quick Start
To create quickly with the following command
pnpm create builderbot@latestBuilding 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()
Send image from URL:3000/v1/messagesBody with number and message. The bot sends the message and answers send.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.