npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

baileys-mbuilder

v4.6.0-lts

Published

Baileys Mbuilder By Nixel - Advanced WhatsApp Interactive Message Builder for Baileys

Readme

Baileys Mbuilder

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.


✨ Features

  • 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

📦 Installation

npm install baileys-mbuilder

postinstall automatically downloads the latest MessageBuilder.js from the official repo.

Dependencies

| Package | Type | | --------- | ---------------------------------------- | | baileys | peer (wajib sudah terinstall di project) | | sharp | langsung terinstall otomatis |


🚀 Quick Start

// 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();

🔄 Auto-Update System

Package ini punya sistem auto-update bawaan yang selalu menjaga versi terbaru dari MessageBuilder.

Manual Update

import MB from "baileys-mbuilder";

await MB.update();
console.log("Updated to version:", MB.VERSION);

Enable Auto-Update (periodic check)

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();

Cara Kerja

  1. Setiap interval, fetch dari repo untuk melihat perubahan
  2. Bandingkan hash sha dengan file lokal dengan repo commit
  3. Jika berbeda, download ulang & reload module via import()
  4. 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.


📚 API Documentation

Button — Simple Button Builder

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 |

ButtonV2 — Multi-row Button Builder

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 |

Carousel — Rich Card Carousel

new MB.Carousel();

| Method | Description | | ----------------- | --------------------------------------------------------------------------- | | .card(callback) | Tambah card (callback punya .image(), .title(), .text(), .button()) | | .build() | Generate payload |

AIRich — AI Rich Response

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 |


🔧 API Functions

| Function | Description | | ------------------------------------- | ------------------------------ | | MB.update(callback?) | Force download & reload module | | MB.enableAutoUpdate(ms?, onUpdate?) | Aktifkan periodic auto-update | | MB.disableAutoUpdate() | Nonaktifkan auto-update |


📄 License

MIT © FongsiDev

Note: The underlying MBuilder library (downloaded from repo) is Copyright © 2026 Nixel(Dev) & FgsiDev(Contributor)


👤 Author

  • Nixel — Original author
  • FongsiDev — npm package publisher

📞 Contact Support