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

khyz-baileys

v2.3.0

Published

Modded Baileys v2 — Interactive Messages, Rich Responses, Albums, Newsletter, Business & More

Readme

Khyz-Baileys


Khyz-Baileys is an open-source modded build of WhiskeySockets/Baileys with native support for interactive messages, album messages, rich AI-style responses, newsletter helpers, payment messages, and additional business/community utilities.

Actively maintained and optimized for stability, fast response, and compatibility with the latest WhatsApp multi-device features.


✨ Features

| Feature | Description | Status | |--------|-------------|--------| | Interactive Messages | Native flow buttons, list menus, copy buttons, URL buttons | ✅ | | Album Messages | Multi-image/video album grouped delivery | ✅ | | Rich Response | sendTable, sendList, sendCodeBlock, sendLink, sendRichMessage | ✅ | | Payment Messages | Request payment with note/sticker support | ✅ | | Product / Catalog | Business product messages with buttons | ✅ | | Event / Poll Result | Event builders and poll result snapshots | ✅ | | Newsletter Extras | Follow, unfollow, mute, bulk follow, subscribers, URL resolve | ✅ | | Order Messages | Order message with status and total | ✅ | | Button Types | single_select, cta_url, cta_copy, cta_call, quick_reply, payment_info | ✅ | | Optimized Connection | Better keepalive, auto session recreation, faster sync | ✅ |


✅ Requirements

  • Node.js >= 20.0.0
  • CommonJS project (no "type": "module" needed)

📦 Installation

"dependencies": {
  "@whiskeysockets/baileys": "github:Khyz-Tzyy/Baileys"
}

Then run:

npm install

🛠️ Quick Start

Import

const {
  default: makeWASocket,
  // other options
} = require('@whiskeysockets/baileys');

Connect with QR Code

const { default: makeWASocket } = require('@whiskeysockets/baileys');

const sock = makeWASocket({
  browser: ['Ubuntu', 'Chrome', '20.00.1'],
  printQRInTerminal: true
});

Connect with Pairing Code

const {
  default: makeWASocket,
  fetchLatestWAWebVersion
} = require('@whiskeysockets/baileys');

const sock = makeWASocket({
  browser: ['Ubuntu', 'Chrome', '20.00.1'],
  printQRInTerminal: false,
  version: await fetchLatestWAWebVersion()
});

const number = '628XXXXXXXXX';
const code = await sock.requestPairingCode(number.trim());
// Custom pairing: sock.requestPairingCode(number, 'ABCD1234')

console.log('Pairing code: ' + code);

📡 Sending Messages

Text Message

await sock.sendMessage(jid, { text: 'Hello!' });

Interactive Message (with buttons)

await sock.sendMessage(jid, {
  interactiveMessage: {
    title: 'Selamat datang!',
    footer: '© KhyzTzyy',
    thumbnail: 'https://example.com/thumb.jpg',
    buttons: [
      {
        name: 'quick_reply',
        buttonParamsJson: JSON.stringify({
          display_text: '📋 Menu',
          id: '.menu'
        })
      },
      {
        name: 'cta_copy',
        buttonParamsJson: JSON.stringify({
          display_text: '📋 Salin Kode',
          copy_code: 'KHYZ2025'
        })
      },
      {
        name: 'cta_url',
        buttonParamsJson: JSON.stringify({
          display_text: '🌐 Website',
          url: 'https://example.com'
        })
      }
    ]
  }
});

Album Message

await sock.sendMessage(jid, {
  albumMessage: [
    { image: { url: './photo1.jpg' }, caption: 'Foto 1' },
    { image: { url: './photo2.jpg' }, caption: 'Foto 2' },
    { video: { url: './video.mp4' }, caption: 'Video' }
  ]
});

Rich Response — Table

await sock.sendTable(
  jid,
  'Java vs JavaScript',
  ['Feature', 'Java', 'JavaScript'],
  [
    ['Type', 'Compiled', 'Interpreted'],
    ['Typing', 'Static', 'Dynamic'],
    ['Main Use', 'Enterprise', 'Web']
  ],
  quoted,
  { headerText: 'Perbandingan:', footer: 'Semoga membantu!' }
);

Rich Response — List

await sock.sendList(
  jid,
  'Info Bot',
  [
    ['Nama', 'Qin Shi'],
    ['Versi', '1.0.0'],
    ['Developer', 'KhyzTzyy']
  ],
  quoted,
  { footer: '© KhyzTzyy' }
);

Rich Response — Code Block

await sock.sendCodeBlock(
  jid,
  `const greeting = 'Hello'\nconsole.log(greeting)`,
  quoted,
  { language: 'javascript', title: '📝 Contoh Kode', footer: 'KhyzTzyy' }
);

Rich Response — Link

await sock.sendLink(
  jid,
  'Hasil upload:\n🔗 {{IE_0}}klik disini{{/IE_0}}',
  ['https://example.com'],
  quoted,
  {
    headerText: '📁 Uploader',
    footer: '✨ Selesai!',
    citations: [{ sourceTitle: 'Server', citationNumber: 1 }]
  }
);

Rich Response — Combined (sendRichMessage)

await sock.sendRichMessage(
  jid,
  [
    { messageType: 2, messageText: '📊 Perbandingan:' },
    {
      messageType: 4,
      tableMetadata: {
        title: 'Bahasa',
        rows: [
          { items: ['Bahasa', 'Use Case'], isHeading: true },
          { items: ['JavaScript', 'Web'] },
          { items: ['Python', 'AI/ML'] }
        ]
      }
    },
    { messageType: 2, messageText: 'Contoh kode:' },
    {
      messageType: 5,
      codeMetadata: {
        codeLanguage: 'javascript',
        codeBlocks: 'console.log("Hello!")' // auto-tokenize
      }
    }
  ],
  quoted,
  { footer: '© KhyzTzyy' }
);

Payment Request

await sock.sendMessage(jid, {
  requestPaymentMessage: {
    amount: 50000,
    currency: 'IDR',
    note: 'Pembayaran order #123',
    from: '[email protected]'
  }
});

Product Message

await sock.sendMessage(jid, {
  productMessage: {
    title: 'Wireless Headphones',
    description: 'Headphone bluetooth kualitas tinggi',
    productId: 'WH-001',
    retailerId: 'khyz-shop',
    url: 'https://example.com/product',
    priceAmount1000: 299000,
    currencyCode: 'IDR',
    thumbnail: { url: 'https://example.com/product.jpg' },
    body: 'Cek produk ini!',
    footer: 'Khyz Shop',
    buttons: [
      {
        name: 'quick_reply',
        buttonParamsJson: JSON.stringify({
          display_text: 'Beli Sekarang',
          id: 'buy_wh001'
        })
      }
    ]
  }
});

Order Message

await sock.sendMessage(jid, {
  orderMessage: {
    orderId: 'ORDER123',
    itemCount: 3,
    status: 'ACCEPTED',
    message: 'Pesanan kamu sudah diterima!',
    orderTitle: 'Order #123',
    sellerJid: '[email protected]',
    totalAmount1000: 150000,
    totalCurrencyCode: 'IDR'
  }
});

Poll Result

await sock.sendMessage(jid, {
  pollResultMessage: {
    name: 'Bahasa Favorit?',
    pollVotes: [
      { optionName: 'JavaScript', optionVoteCount: 42 },
      { optionName: 'Python', optionVoteCount: 38 }
    ],
    newsletter: {
      newsletterName: 'KhyzTzyy',
      newsletterJid: '120363401718869058@newsletter'
    }
  }
});

📡 Newsletter Methods

// Follow channel
await sock.newsletterFollow('120363xxx@newsletter');

// Unfollow
await sock.newsletterUnfollow('120363xxx@newsletter');

// Mute / Unmute
await sock.newsletterMute('120363xxx@newsletter');
await sock.newsletterUnmute('120363xxx@newsletter');

// Bulk follow
await sock.newsletterMultipleFollow(['id1@newsletter', 'id2@newsletter']);

// Get subscriber count
const { subscribers } = await sock.newsletterSubscribers('120363xxx@newsletter');

// Resolve URL ke metadata
const info = await sock.cekIDSaluran('https://whatsapp.com/channel/xxx');
console.log(info.name, info.subscribers);

// React ke postingan
await sock.newsletterReactMessage('120363xxx@newsletter', serverId, '👍');

// Fetch semua channel yang diikuti
const channels = await sock.newsletterFetchAllSubscribe();

🙏 Credits

const credits = new Map([
  ['KhyzTzyy', 'Modification & Maintenance'],
  ['WhiskeySockets', 'Original Baileys'],
  ['Gupong', 'Base Fork Reference']
]);