khyz-baileys
v2.3.0
Published
Modded Baileys v2 — Interactive Messages, Rich Responses, Albums, Newsletter, Business & More
Maintainers
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']
]);