By Nixel | Published by FongsiDev
Advanced WhatsApp Interactive Message Builder built for creating buttons, carousels, native flows, and AI rich response payloads using Baileys with fluent chaining, flexible payload customization, and scalable architecture for modern bot development.
- Button (v1) — Single-row button messages with up to 3 buttons
- ButtonV2 (v2) — Multi-row button messages with configurable layout
- Carousel — Rich horizontal card carousel with images, text, and buttons
- AIRich — AI-powered rich response with hyperlinks, LaTeX, citations, code blocks, tables
- Auto-Update — Built-in auto-update mechanism from official repo
- Hot Reload — Proxy-based default export always points to latest module version
npm install baileys-mbuilder
postinstallautomatically downloads the latestMessageBuilder.jsfrom the official repo.
| Package | Type |
|---|---|
baileys |
peer (wajib sudah terinstall di project) |
sharp |
langsung terinstall otomatis |
// Default import (recommended — supports hot-reload / auto-update)
import MB from "baileys-mbuilder";
// ── Simple Button ────────────────────────
const msg = new MB.Button()
.text("Hello! Click below.")
.button("Click Me", "click_1")
.button("Cancel", "cancel_1")
.footer("Footer here")
.build();
// ── Multi-row Button ─────────────────────
const msg2 = new MB.ButtonV2()
.text("Choose:")
.row((r) => r.button("A", "a").button("B", "b"))
.row((r) => r.button("C", "c"))
.build();
// ── Carousel ─────────────────────────────
const msg3 = new MB.Carousel()
.card((c) =>
c
.image("https://example.com/img.jpg")
.title("Card Title")
.text("Description")
.button("Detail", "detail_1"),
)
.build();
// ── AI Rich Response ─────────────────────
const msg4 = new MB.AIRich()
.text("Visit [Google](https://google.com) for details")
.build();Package ini punya sistem auto-update bawaan yang selalu menjaga versi terbaru dari MessageBuilder.
import MB from "baileys-mbuilder";
await MB.update();
console.log("Updated to version:", MB.VERSION);import MB from "baileys-mbuilder";
// Cek update setiap 5 menit, dengan callback
MB.enableAutoUpdate(300000, (status) => {
if (status === "updated") {
console.log("Ada versi baru!");
}
});
// Nonaktifkan
MB.disableAutoUpdate();- Setiap interval, fetch dari repo untuk melihat perubahan
- Bandingkan hash sha dengan file lokal dengan repo commit
- Jika berbeda, download ulang & reload module via
import() - Default export (Proxy) otomatis mengarah ke module terbaru
Catatan: Named imports (
import MB from ...) bersifat static — tidak akan berubah setelah auto-update, kecuali di panggil lagi Gunakan default import (import MB from ...) untuk selalu mendapatkan class/fungsi terbaru.
new MB.Button();| Method | Description |
|---|---|
.text(t) |
Body text |
.button(label, id) |
Tambah button (max 3) |
.footer(t) |
Footer text |
.header(t) |
Header text |
.viewOnce() |
View-once mode |
.build() |
Generate payload |
new MB.ButtonV2();| Method | Description |
|---|---|
.text(t) |
Body text |
.row(callback) |
Tambah row (callback punya .button()) |
.footer(t) |
Footer text |
.header(t) |
Header text |
.viewOnce() |
View-once mode |
.build() |
Generate payload |
new MB.Carousel();| Method | Description |
|---|---|
.card(callback) |
Tambah card (callback punya .image(), .title(), .text(), .button()) |
.build() |
Generate payload |
new MB.AIRich();| Method | Description |
|---|---|
.text(t) |
Set text dengan inline syntax |
.extract(bool) |
Aktifkan/nonaktifkan ekstraksi (default: true) |
.hyperlink(bool) |
Aktifkan hyperlink [text](url) |
.citation(bool) |
Aktifkan auto citation |
.latex(bool) |
Aktifkan LaTeX [text|...](url) |
.build() |
Generate payload |
| Function | Description |
|---|---|
MB.update(callback?) |
Force download & reload module |
MB.enableAutoUpdate(ms?, onUpdate?) |
Aktifkan periodic auto-update |
MB.disableAutoUpdate() |
Nonaktifkan auto-update |
MIT © FongsiDev
Note: The underlying MBuilder library (downloaded from repo) is Copyright © 2026 Nixel(Dev) & FgsiDev(Contributor)
- Nixel — Original author
- FongsiDev — npm package publisher
- WhatsApp: WhatsApp Number
- Channel: WhatsApp Channel