@freezeehost/baileys
v2.1.4
Published
Baileys is a lightweight JavaScript library for interacting with the WhatsApp Web API using WebSocket.
Maintainers
Readme
📚 Table of Contents
🌟 Features
- ✅ Multi-Device Support
- 🔄 Real-Time Messaging (text, media, polls, buttons)
- 🛠️ Group & Channel Management (create, modify, invite)
- 🔒 End-to-End Encryption
- 📦 Session Persistence
🔥 Updated New (14 Oktober 2025)
- 🍟 Convert LID Mentions to JID
- 🤖 Convert Sender LID to JID
- 👥 Convert Group ID LID to JID
- 🩸 Fixed All Bug LID (participant - mentionedJid - sender - admins group)
- ✨ Dependencities Update (vulnerabilities deleted)
- 🍡 watermark (RYUU)
🌱 Owner’s Notice
Proyek ini bersifat publik, sehingga siapa pun dapat menggunakan atau melakukan rename untuk keperluan pribadi. Namun, penggunaan untuk tujuan komersial atau sekadar pencarian nama tidak diperkenankan.
Proyek ini dikembangkan berdasarkan libary Whiskeysocket, dengan perbaikan dan peningkatan yang dilakukan oleh administrator.
Tujuan utama dari proyek ini adalah untuk memudahkan pengguna serta memperbaiki kesalahan bot yang sebelumnya sering dialami.
Saat ini proyek masih dalam tahap Beta, sehingga kemungkinan masih terdapat bug atau kendala tak terduga saat proses instalasi maupun eksekusi.
Jika Anda mengalami masalah yang berlanjut, silakan hubungi kami melalui kontak yang telah tersedia.
Terimakasih, salam hangat, ryuu!
⚡ Contact Admin
📜 License
- This project is licensed for personal and non-commercial use only.
- Redistribution, modification, or renaming for personal purposes is allowed.
- Commercial use, resale, or name-hunting is strictly prohibited.
🤝 Contribution Guidelines
We welcome contributions to improve this project. To contribute:
- Fork the repository
- Create a new branch for your feature or fix
- Submit a pull request with a clear explanation of the changes
All contributions will be reviewed before merging.
📥 Installation
npm install @ryuu-reinzz/baileys
# or
yarn add @ryuu-reinzz/baileys🚀 Quick Start
const {
default: makeWASocket,
useMultiFileAuthState,
} = require('@ryuu-reinzz/baileys');
const {
state,
saveCreds
} = await useMultiFileAuthState("./path/to/sessions/folder")
/*
* const RyuuBotz = makeWASocket({ printQRInTerminal: true });
* code to get WhatsApp web connection
* QR code or pairing code type available
*/
RyuuBotz.ev.on('messages.upsert', ({ messages }) => {
console.log('New message:', messages[0].message);
});📖 Documentation
🔌 Connecting Account
const RyuuBotz = makeWASocket({
printQRInTerminal: true, // true to display QR Code
auth: state
})const RyuuBotz = makeWASocket({
printQRInTerminal: false, // false so that the pairing code is not disturbed
auth: state
})
if (!RyuuBotz.authState.creds.registered) {
const number = "62xxxx"
// use default pairing code (default 1-8)
const code = await RyuuBotz.requestPairingCode(number)
// use customer code pairing (8 digit)
const customCode = "ABCD4321"
const code = await RyuuBotz.requestPairingCode(number, customCode)
console.log(code)
}📡 Handling Events
RyuuBotz.ev.on('messages.upsert', ({ messages }) => {
console.log('New message:', messages[0].message);
});RyuuBotz.ev.on('messages.update', (m) => {
if (m.pollUpdates) console.log('Poll vote:', m.pollUpdates);
});📨 Sending Messages
/**
* Sends a message using the WhatsApp socket connection.
*
* @param {string} jid - The JID (Jabber ID) of the recipient/user.
* This is the unique identifier for the WhatsApp user/group.
* @param {Object} content - The message content to be sent. Can be any valid message type
* (text, image, video, document, etc.) with required parameters.
* @param {Object} [options] - Optional parameters for message generation and sending.
* Can include properties like:
* - quoted: Message to reply to
* - ephemeral: If message should disappear after viewing
* - mediaUpload: Media upload options
* - etc.
* @returns {Promise<Object>} A promise that resolves with the sent message info or
* rejects with an error if sending fails.
*/
const jid = ''; // Recipient's JID (WhatsApp ID) or LID
const content = {}; // Message content object
const options = {}; // Optional message options
// Send the message using the WhatsApp socket connection
RyuuBotz.sendMessage(jid, content, options)// Simple Text
await RyuuBotz.sendMessage(jid, { text: 'Hello!' });// Text with link preview
await RyuuBotz.sendMessage(jid, {
text: 'Visit https://example.com',
linkPreview: {
'canonical-url': 'https://example.com',
title: 'Example Domain',
description: 'A demo website',
jpegThumbnail: fs.readFileSync('preview.jpg')
}
});// With Quoted Reply
await RyuuBotz.sendMessage(jid, { text: 'Hello Shiroko!' }, { quoted: message });// With local file buffer
await RyuuBotz.sendMessage(jid, {
image: fs.readFileSync('shiroko.jpg'),
caption: 'My wife!',
mentions: ['[email protected]'] // Tag users
});// With URL
await RyuuBotz.sendMessage(jid, {
image: { url: 'https://example.com/shiroko.jpg' },
caption: 'Emh ayang nya zass'
});// With Local File
await RyuuBotz.sendMessage(jid, {
video: fs.readFileSync('video.mp4'),
caption: 'Funny clip!'
});// With URL File
await RyuuBotz.sendMessage(jid, {
video: { url: 'https://example.com/video.mp4' },
caption: 'Streamed video'
});// View Once Message
await RyuuBotz.sendMessage(jid, {
video: fs.readFileSync('secret.mp4'),
viewOnce: true // Disappears after viewing
});// Regular audio
await RyuuBotz.sendMessage(jid, {
audio: fs.readFileSync('audio.mp3'),
ptt: false // For music
});// Push-to-talk (PTT)
await RyuuBotz.sendMessage(jid, {
audio: fs.readFileSync('voice.ogg'),
ptt: true, // WhatsApp voice note
waveform: [0, 1, 0, 1, 0] // Optional waveform
});const vcard = 'BEGIN:VCARD\n' // metadata of the contact card
+ 'VERSION:3.0\n'
+ 'FN:Jeff Singh\n' // full name
+ 'ORG:Ashoka Uni\n' // the organization of the contact
+ 'TELtype=CELLtype=VOICEwaid=911234567890:+91 12345 67890\n' // WhatsApp ID + phone number
+ 'END:VCARD'
await RyuuBotz.sendMessage(jid, {
contacts: {
displayName: 'Your Name',
contacts: [{ vcard }]
}
})// Simple send sticker
await RyuuBotz.sendSticker(jid, {
sticker: './your/path', //user path
packname: "your packname",
author: "your author"
}
);// Simple send sticker
await RyuuBotz.sendSticker(jid, {
sticker: { url : "https://your.url.com/image.webp" }, //user url
packname: "your packname",
author: "your author"
}
);// Simple send sticker
await RyuuBotz.sendSticker(jid, {
sticker: fs.readFileSync('sticker.webp'), //use buffer
packname: "your packname",
author: "your author"
}
);await RyuuBotz.sendMessage(jid, {
react: {
text: '👍', // use an empty string to remove the reaction
key: message.key
}
})| Time | Seconds | |-------|----------------| | 24h | 86.400 | | 7d | 604.800 | | 30d | 2.592.000 |
// Pin Message
await RyuuBotz.sendMessage(jid, {
pin: {
type: 1, // 2 to remove
time: 86400,
key: message.key
}
})// Keep message
await RyuuBotz.sendMessage(jid, {
keep: {
key: message.key,
type: 1 // or 2 to remove
}
})// Static location
await RyuuBotz.sendMessage(jid, {
location: {
degreesLatitude: 37.422,
degreesLongitude: -122.084,
name: 'Google HQ'
}
});// Thumbnail location
await RyuuBotz.sendMessage(jid, {
location: {
degreesLatitude: 37.422,
degreesLongitude: -122.084,
name: 'Google HQ',
jpegThumbnail: fs.readFileSync('preview.jpg')
}
});// Live location (updates in real-time)
await RyuuBotz.sendMessage(jid, {
location: {
degreesLatitude: 37.422,
degreesLongitude: -122.084,
accuracyInMeters: 10
},
live: true, // Enable live tracking
caption: 'I’m here!'
});await RyuuBotz.sendMessage(jid, {
call: {
name: 'Here is call message',
type: 1 // 2 for video
}
})await RyuuBotz.sendMessage(jid, {
event: {
isCanceled: false, // or true
name: 'Here is name event',
description: 'Short description here',
location: {
degreesLatitude: 0,
degreesLongitude: 0,
name: 'Gedung Tikus Kantor'
},
startTime: 17..., // timestamp date
endTime: 17..., // timestamp date
extraGuestsAllowed: true // or false
}
})await RyuuBotz.sendMessage(jid, {
order: {
orderId: '123xxx',
thumbnail: fs.readFileSync('preview.jpg'),
itemCount: '123',
status: 'INQUIRY', // INQUIRY || ACCEPTED || DECLINED
surface: 'CATALOG',
message: 'Here is order message',
orderTitle: 'Here is title order',
sellerJid: '[email protected]'',
token: 'token_here',
totalAmount1000: '300000',
totalCurrencyCode: 'IDR'
}
})// Create a poll
await RyuuBotz.sendMessage(jid, {
poll: {
name: 'Favorite color?',
values: ['Red', 'Blue', 'Green'],
selectableCount: 1 // Single-choice
}
});// Poll results (snapshot)
await RyuuBotz.sendMessage(jid, {
pollResult: {
name: 'Favorite color?',
values: [['Red', 10], ['Blue', 20]] // [option, votes]
}
});await RyuuBotz.sendMessage(jid, {
product: {
productId: '123',
title: 'Cool T-Shirt',
description: '100% cotton',
price: 1999, // In cents (e.g., $19.99)
currencyCode: 'USD',
productImage: fs.readFileSync('shirt.jpg')
}
});await RyuuBotz.sendMessage(jid, {
payment: {
note: 'Here is payment message',
currency: 'USD', // optional
offset: 0, // optional
amount: '100000', // optional
expiry: 0, // optional
from: '[email protected]', // optional
image: { // optional
placeholderArgb: "your_background", // optional
textArgb: "your_text", // optional
subtextArgb: "your_subtext" // optional
}
}
})await RyuuBotz.sendMessage(jid, {
paymentInvite: {
type: 1, // 1 || 2 || 3
expiry: 0
}
})await RyuuBotz.sendMessage(jid, {
adminInvite: {
jid: '172xxx@newsletter',
name: 'Newsletter Title',
caption: 'Undangan admin channel saya',
expiration: 86400,
jpegThumbnail: fs.readFileSync('preview.jpg') // optional
}
})await RyuuBotz.sendMessage(jid, {
groupInvite: {
jid: '[email protected]',
name: 'Group Name!',
caption: 'Invitation To Join My Whatsapp Group',
code: 'xYz3yAtf...', // code invite link
expiration: 86400,
jpegThumbnail: fs.readFileSync('preview.jpg') // optional
}
})// Request phone number
await RyuuBotz.sendMessage(jid, {
requestPhoneNumber: {}
})// Share phone number
await RyuuBotz.sendMessage(jid, {
sharePhoneNumber: {}
})// Reply List Message
await RyuuBotz.sendMessage(jid, {
buttonReply: {
name: 'Hii',
description: 'description',
rowId: 'ID'
},
type: 'list'
})// Reply Button Message
await RyuuBotz.sendMessage(jid, {
buttonReply: {
displayText: 'Hii',
id: 'ID'
},
type: 'plain'
})// Reply Template Message
await RyuuBotz.sendMessage(jid, {
buttonReply: {
displayText: 'Hii',
id: 'ID',
index: 1 // number id button reply
},
type: 'template'
})// Reply Interactive Message
await RyuuBotz.sendMessage(jid, {
buttonReply: {
body: 'Hii',
nativeFlows: {
name: 'menu_options',
paramsJson: JSON.stringify({ id: 'ID', description: 'description' })
version: 1 // 2 | 3
}
},
type: 'interactive'
})await RyuuBotz.sendStatusMentions({
image: {
url: 'https://example.com/image.jpg'
},
caption: 'Nice day!'
}, ["[email protected]", "[email protected]"])await RyuuBotz.sendAlbumMessage(jid,
[{
image: { url: 'https://example.com/image.jpg' },
caption: 'Hello World'
},
{
image: fs.readFileSync('image.jpg'),
caption: 'Hello World'
},
{
video: { url: 'https://example.com/video.mp4' },
caption: 'Hello World'
},
{
video: fs.readFileSync('video.mp4'),
caption: 'Hello World'
}],
{ quoted: message, delay: 3000 })This is an interactive chat created based on Proto WhatsApp business data, if the message does not work then there may be a change in the buttonParamsJson structure.
// Headers Text
await RyuuBotz.sendMessage(jid, {
text: 'Here is body message',
title: 'Here is title',
subtitle: 'Here is subtitle',
footer: '© WhatsApp Baileys',
viewOnce: true,
shop: {
surface: 1, // 2 | 3 | 4
id: 'facebook_store_name'
}
})// Headers Image
await RyuuBotz.sendMessage(jid, {
image: {
url: 'https://www.example.com/image.jpg'
},
caption: 'Here is body message',
title: 'Here is title',
subtitle: 'Here is subtitle',
footer: '© WhatsApp Baileys',
shop: {
surface: 1, // 2 | 3 | 4
id: 'facebook_store_name'
},
hasMediaAttachment: true, // or false
viewOnce: true
})// Headers Video
await RyuuBotz.sendMessage(jid, {
video: {
url: 'https://www.example.com/video.mp4'
},
caption: 'Here is body message',
title: 'Here is title',
subtitle: 'Here is subtitle',
footer: '© WhatsApp Baileys',
shop: {
surface: 1, // 2 | 3 | 4
id: 'facebook_store_name'
},
hasMediaAttachment: true, // or false
viewOnce: true
})// Headers Document
await RyuuBotz.sendMessage(jid, {
document: {
url: 'https://www.example.com/document.pdf'
},
mimetype: 'application/pdf',
jpegThumbnail: await RyuuBotz.resize('https://www.example.com/thumbnail.jpg', 320, 320),
caption: 'Here is body message',
title: 'Here is title',
subtitle: 'Here is subtitle',
footer: '© WhatsApp Baileys',
shop: {
surface: 1, // 2 | 3 | 4
id: 'facebook_store_name'
},
hasMediaAttachment: false, // or true,
viewOnce: true
})// Headers Location
await RyuuBotz.sendMessage(jid, {
location: {
degressLatitude: -0,
degressLongitude: 0,
name: 'Example Location'
},
caption: 'Here is body message',
title: 'Here is title',
subtitle: 'Here is subtitle',
footer: '© WhatsApp Baileys',
shop: {
surface: 1, // 2 | 3 | 4
id: 'facebook_store_name'
},
hasMediaAttachment: false, // or true
viewOnce: true
})// Headers Product
await RyuuBotz.sendMessage(jid, {
product: {
productImage: {
url: 'https://www.example.com/product.jpg'
},
productId: '23942543532047956', // catalog business ID
title: 'Example Product',
description: 'Example Product Description',
currencyCode: 'IDR',
priceAmount1000: '2000000',
retailerId: 'ExampleRetailer',
url: 'https://www.example.com/product',
productImageCount: 1
},
businessOwnerJid: '[email protected]',
caption: 'Here is body message',
title: 'Here is title',
subtitle: 'Here is subtitle',
footer: '© WhatsApp Baileys',
shop: {
surface: 1, // 2 | 3 | 4
id: 'facebook_store_name'
},
hasMediaAttachment: false, // or true
viewOnce: true
})await RyuuBotz.sendMessage(jid, {
text: 'Here is body message',
title: 'Here is title',
subtile: 'Here is subtitle',
footer: '© WhatsApp baileys',
cards: [{
image: { url: 'https://www.example.com/image.jpg' }, // or buffer
title: 'The title cards',
body: 'The body cards',
footer: '© WhatsApp',
buttons: [{
name: 'quick_reply',
buttonParamsJson: JSON.stringify({
display_text: 'Display Text',
id: '123'
})
},
{
name: 'cta_url',
buttonParamsJson: JSON.stringify({
display_text: 'Display Text',
url: 'https://www.example.com'
})
}]
},
{
video: { url: 'https://www.example.com/video.mp4' }, // or buffer
title: 'The title cards 2',
body: 'The body cards 2',
footer: '© WhatsApp',
buttons: [{
name: 'quick_reply',
buttonParamsJson: JSON.stringify({
display_text: 'Display Text',
id: 'ID'
})
},
{
name: 'cta_url',
buttonParamsJson: JSON.stringify({
display_text: 'Display Text',
url: 'https://www.example.com'
})
}]
}]
})Native flow messages are used to display various types of button messages, even for flow dialogs. These buttons are easy to use and are often able to accommodate many parameters.
// Headers text
await RyuuBotz.sendMessage(jid, {
text: 'This is body message!',
title: 'This is title',
subtitle: 'This is subtitle',
footer: '© WhatsApp Baileys',
interactive: native_flow_button
})// Headers image
await RyuuBotz.sendMessage(jid, {
image: { url: 'https://www.example.com/image.jpg' },
caption: 'This is body message!',
title: 'This is title',
subtitle: 'This is subtitle',
footer: '© WhatsApp Baileys',
hasMediaAttachment: true,
interactive: native_flow_button
})// Headers Video
await RyuuBotz.sendMessage(jid, {
video: { url: 'https://www.example.com/video.mp4' },
caption: 'This is body message!',
title: 'This is title',
subtitle: 'This is subtitle',
footer: '© WhatsApp Baileys',
hasMediaAttachment: true,
interactive: native_flow_button
})// Headers Document
await RyuuBotz.sendMessage(jid, {
document: { url: 'https://www.example.com/document.pdf' },
jpegThumbnail: fs.readFileSync('preview.jpg'),
mimetype: 'application/pdf',
caption: 'This is body message!',
title: 'This is title',
subtitle: 'This is subtitle',
footer: '© WhatsApp Baileys',
hasMediaAttachment: true,
interactive: native_flow_button
})// Headers Location
await RyuuBotz.sendMessage(jid, {
location: {
degressLatitude: -0,
degressLongitude: 0,
name: 'Here is name location'
},
caption: 'This is body message!',
title: 'This is title',
subtitle: 'This is subtitle',
footer: '© WhatsApp Baileys',
hasMediaAttachment: true,
interactive: native_flow_button
})// Headers Product
await RyuuBotz.sendMessage(jid, {
product: {
productImage: {
url: 'https://www.example.com/product.jpg'
},
productId: '23942543532047956', // catalog business ID
title: 'Example Product',
description: 'Example Product Description',
currencyCode: 'IDR',
priceAmount1000: '2000000',
retailerId: 'ExampleRetailer',
url: 'https://www.example.com/product',
productImageCount: 1
},
businessOwnerJid: '[email protected]',
caption: 'This is body message!',
title: 'This is title',
subtitle: 'This is subtitle',
footer: '© WhatsApp Baileys',
hasMediaAttachment: true,
interactive: native_flow_button
})const native_flow_button = [{
name: 'quick_reply',
buttonParamsJson: JSON.stringify({
display_text: 'Quick Reply',
id: '123'
})
}]const native_flow_button = [{
name: 'cta_url',
buttonParamsJson: JSON.stringify({
display_text: 'Action URL',
url: 'https://www.example.com',
merchant_url: 'https://www.example.com'
})
}]const native_flow_button = [{
name: 'cta_copy',
buttonParamsJson: JSON.stringify({
display_text: 'Action Copy',
copy_code: '12345678'
})
}]const native_flow_button = [{
name: 'cta_call',
buttonParamsJson: JSON.stringify({
display_text: 'Action Call',
phone_number: '628xxx'
})
}]const native_flow_button = [{
name: 'cta_catalog',
buttonParamsJson: JSON.stringify({
business_phone_number: '628xxx'
})
}]const native_flow_button = [{
name: 'cta_reminder',
buttonParamsJson: JSON.stringify({
display_text: 'Action Reminder'
})
}]const native_flow_button = [{
name: 'cta_cancel_reminder',
buttonParamsJson: JSON.stringify({
display_text: 'Action Unreminder'
})
}]const native_flow_button = [{
name: 'address_message',
buttonParamsJson: JSON.stringify({
display_text: 'Form Location'
})
}]const native_flow_button = [{
name: 'send_location',
buttonParamsJson: JSON.stringify({
display_text: 'Send Location'
})
}]const native_flow_button = [{
name: 'open_webview',
buttonParamsJson: JSON.stringify({
title: 'URL Web View',
link: {
in_app_webview: true, // or false
url: 'https://www.example.com'
}
})
}]const native_flow_button = [{
name: 'mpm',
buttonParamsJson: JSON.stringify({
product_id: '23942543532047956'
})
}]const native_flow_button = [{
name: 'wa_payment_transaction_details',
buttonParamsJson: JSON.stringify({
transaction_id: '12345848'
})
}]const native_flow_button = [{
name: 'automated_greeting_message_view_catalog',
buttonParamsJson: JSON.stringify({
business_phone_number: '628xxx',
catalog_product_id: '23942543532047956'
})
}]const native_flow_button = [{
name: 'galaxy_message',
buttonParamsJson: JSON.stringify({
mode: 'published',
flow_message_version: '3',
flow_token: '1:1307913409923914:293680f87029f5a13d1ec5e35e718af3',
flow_id: '1307913409923914',
flow_cta: 'Here is button form',
flow_action: 'navigate',
flow_action_payload: {
screen: 'QUESTION_ONE',
params: {
user_id: '123456789',
referral: 'campaign_xyz'
}
},
flow_metadata: {
flow_json_version: '201',
data_api_protocol: 'v2',
flow_name: 'Lead Qualification [en]',
data_api_version: 'v2',
categories: ['Lead Generation', 'Sales']
}
})
}]const native_flow_button = [{
name: 'single_select',
buttonParamsJson: JSON.stringify({
title: 'Selection Button',
sections: [{
title: 'Title 1',
highlight_label: 'Highlight label 1',
rows: [{
header: 'Header 1',
title: 'Title 1',
description: 'Description 1',
id: 'Id 1'
},
{
header: 'Header 2',
title: 'Title 2',
description: 'Description 2',
id: 'Id 2'
}
]
}]
})
}]await RyuuBotz.sendMessage(jid, {
product: {
productId: '123',
title: 'Cool T-Shirt',
description: '100% cotton',
price: 1999, // In cents (e.g., $19.99)
currencyCode: 'USD',
productImage: fs.readFileSync('shirt.jpg')
}
});This message button may not work if WhatsApp prohibits the free and open use of the message button. Use a WhatsApp partner if you still want to use the message button.
// Button Headers Text
await RyuuBotz.sendMessage(jid, {
text: 'Choose an option:',
buttons: button_params,
footer: '© WhatsApp Baileys'
});// Button Headers Image
await RyuuBotz.sendMessage(jid, {
image: fs.readFileSync('image.jpg'),
caption: 'Choose an option:',
buttons: button_params,
footer: '© WhatsApp Baileys'
});// Button Headers Video
await RyuuBotz.sendMessage(jid, {
video: fs.readFileSync('video.mp4'),
caption: 'Choose an option:',
buttons: button_params,
footer: '© WhatsApp Baileys'
});// Button Headers Location
await RyuuBotz.sendMessage(jid, {
location: {
degreesLatitude: 37.422,
degreesLongitude: -122.084
},
caption: 'Choose an option:',
buttons: button_params,
footer: '© WhatsApp Baileys'
});// Button Params Default
const button_params = [{
buttonId: 'id1',
buttonText: {
displayText: 'Option 1'
},
type: 1
},{
buttonId: 'id2',
buttonText: {
displayText: 'Option 2'
},
type: 1
}]// Button Params NativeFlow
const button_params = [{
buttonId: 'id1',
buttonText: {
displayText: 'Option 1'
},
type: 1
},{
buttonId: 'flow',
buttonText: {
displayText: 'flow'
},
nativeFlowInfo: {
name: 'cta_url',
buttonParamsJson: JSON.stringify({
display_text: 'Visit URL',
url: 'https://web.whatsapp.com',
merchant_url: 'https://web.whatsapp.com'
})
},
type: 2
}]// Single Select
await RyuuBotz.sendMessage(jid, {
text: 'Menu:',
sections: [
{ title: 'Food', rows: [
{ title: 'Pizza', rowId: 'pizza' },
{ title: 'Burger', rowId: 'burger' }
]}
],
buttonText: 'Browse'
});// Product List
await RyuuBotz.sendMessage(jid, {
title: 'Here is title product',
text: 'Text message',
footer: '© WhatsApp Baileys',
buttonText: 'Select Menu',
productList: [{
title: 'Product Collection',
products: [{
productId: '23942543532047956' // catalog business ID
}]
}],
businessOwnerJid: '[email protected]',
thumbnail: { url: 'https://www.example.com/file' }
})📣 Newsletter
// code can't have "https://whatsapp.com/channel/", only code
const newsletter = await RyuuBotz.newsletterMetadata("invite", "0029Vb6w7eO9sBIEUYRgeC30")
console.log("Newsletter metadata:", newsletter)// from jid newsletter
const newsletter = await RyuuBotz.newsletterMetadata("jid", "120363421570647022@newsletter")
console.log("Newsletter metadata:", newsletter)await RyuuBotz.newsletterFollow("120363421570647022@newsletter")await RyuuBotz.newsletterUnfollow("120363421570647022@newsletter")await RyuuBotz.newsletterMute("120363421570647022@newsletter")await RyuuBotz.newsletterUnmute("120363421570647022@newsletter")// Allow all emoji
await RyuuBotz.newsletterReactionMode("120363421570647022@newsletter", "ALL")// Allow special emoji (👍, ❤️, 😯, 😢, 🙏)
await RyuuBotz.newsletterReactionMode("120363421570647022@newsletter", "BASIC")// No reaction allowed
await RyuuBotz.newsletterReactionMode("120363421570647022@newsletter", "NONE")await RyuuBotz.newsletterUpdateDescription("120363421570647022@newsletter", "News description here!")await RyuuBotz.newsletterUpdateName("120363421570647022@newsletter", "New newsletter name!")// Change
await RyuuBotz.newsletterUpdatePicture("120363421570647022@newsletter", { url: 'https://example.com/image.jpg' })// Remove
await RyuuBotz.newsletterRemovePicture("120363421570647022@newsletter")const newsletter = await RyuuBotz.newsletterCreate("Here is name newsletter!", "Here is description!", { url: 'https://example.com/image.jpg' })
console.log("Here is data new created newsletter:", newsletter)const list_newsletter = await RyuuBotz.newsletterFetchAllParticipating()
console.log("Your list newsletter join:", list_newsletter)await RyuuBotz.newsletterChangeOwner("120363421570647022@newsletter", "123@lid")await RyuuBotz.newsletterDemote("120363421570647022@newsletter", "123@lid")await RyuuBotz.newsletterReactMessage("120363421570647022@newsletter", "12", "🦖")🛠️ Groups
const group = await RyuuBotz.groupCreate("New Group Title", ["[email protected]", "[email protected]"]);
console.log("New group create data:", group)// only allow admins to send messages
await RyuuBotz.groupSettingUpdate(jid, 'announcement')// allow everyone to send messages
await RyuuBotz.groupSettingUpdate(jid, 'not_announcement')// allow everyone to modify the group's settings -- like display picture etc.
await RyuuBotz.groupSettingUpdate(jid, 'unlocked')// only allow admins to modify the group's settings
await RyuuBotz.groupSettingUpdate(jid, 'locked')// add member
await RyuuBotz.groupParticipantsUpdate(jid, ['[email protected]', '[email protected]'], 'add')
// remove member
await RyuuBotz.groupParticipantsUpdate(jid, ['[email protected]', '[email protected]'], 'remove')
// promote member (admins)
await RyuuBotz.groupParticipantsUpdate(jid, ['[email protected]', '[email protected]'], 'promote')
// demote member (unadmins)
await RyuuBotz.groupParticipantsUpdate(jid, ['[email protected]', '[email protected]'], 'demote')await RyuuBotz.groupUpdateSubject(jid, 'New Subject Title!')await RyuuBotz.groupUpdateDescription(jid, 'New Description!')await RyuuBotz.groupLeave(jid)// to create link with code use "https://chat.whatsapp.com/" + code
const code = await RyuuBotz.groupInviteCode(jid)
console.log('group code: ' + code)const code = await RyuuBotz.groupRevokeInvite(jid)
console.log('New group code: ' + code)// code can't have "https://chat.whatsapp.com/", only code
const response = await RyuuBotz.groupAcceptInvite(code)
console.log('joined to: ' + response)const response = await RyuuBotz.groupGetInviteInfo(code)
console.log('group information: ' + response)const metadata = await RyuuBotz.groupMetadata(jid)
console.log(metadata.id + ', title: ' + metadata.subject + ', description: ' + metadata.desc)const response = await RyuuBotz.groupAcceptInviteV4(jid, groupInviteMessage)
console.log('joined to: ' + response)const response = await RyuuBotz.groupRequestParticipantsList(jid)
console.log(response)// Approve
const response = await RyuuBotz.groupRequestParticipantsUpdate(jid, ['[email protected]', '[email protected]'], 'approve')// Reject
const response = await RyuuBotz.groupRequestParticipantsUpdate(jid, ['[email protected]', '[email protected]'], 'reject')const response = await RyuuBotz.groupFetchAllParticipating()
console.log(response)- Ephemeral can be:
| Time | Seconds | |-------|----------------| | Remove | 0 | | 24h | 86.400 | | 7d | 604.800 | | 90d | 7.776.000 |
await RyuuBotz.groupToggleEphemeral(jid, 86400)// Everyone Member
await RyuuBotz.groupMemberAddMode(jid, 'all_member_add')// Only Admin
await RyuuBotz.groupMemberAddMode(jid, 'admin_add')🔒 Privacy
// Change
await RyuuBotz.updateProfilePicture(jid, { url: 'https://example.com/image.jpg' })// Remove
await RyuuBotz.removeProfilePicture(jid)// Block
await RyuuBotz.updateBlockStatus(jid, 'block');// Unblock
await RyuuBotz.updateBlockStatus(jid, 'unblock');const privacySettings = await RyuuBotz.fetchPrivacySettings(true)
console.log('privacy settings: ' + privacySettings)const response = await RyuuBotz.fetchBlocklist()
console.log(response)// Everyone
await RyuuBotz.updateLastSeenPrivacy("all")// Contacts
await RyuuBotz.updateLastSeenPrivacy("contacts")// Contacts Blacklist
await RyuuBotz.updateLastSeenPrivacy("contact_blacklist")// Hide
await RyuuBotz.updateLastSeenPrivacy("none")// Everyone
await RyuuBotz.updateOnlinePrivacy("all")// Match last seen
await RyuuBotz.updateOnlinePrivacy("match_last_seen")// Everyone
await RyuuBotz.updateProfilePicturePrivacy("all")// Contacts
await RyuuBotz.updateProfilePicturePrivacy("contacts")// Contacts Blacklist
await RyuuBotz.updateProfilePicturePrivacy("contact_blacklist")// Hide
await RyuuBotz.updateProfilePicturePrivacy("none")// Everyone
await RyuuBotz.updateStatusPrivacy("all")// Contacts
await RyuuBotz.updateStatusPrivacy("contacts")// Contacts Blacklist
await RyuuBotz.updateStatusPrivacy("contact_blacklist")// Hide
await RyuuBotz.updateStatusPrivacy("none")// Show
await RyuuBotz.updateReadReceiptsPrivacy("all")// Hide
await RyuuBotz.updateReadReceiptsPrivacy("none")// Everyone
await RyuuBotz.updateGroupsAddPrivacy("all")// Contacts
await RyuuBotz.updateGroupsAddPrivacy("contacts")// Contacts Blacklist
await RyuuBotz.updateGroupsAddPrivacy("contact_blacklist")| Time | Seconds | |-------|----------------| | Remove | 0 | | 24h | 86.400 | | 7d | 604.800 | | 90d | 7.776.000 |
await RyuuBotz.updateDefaultDisappearingMode(86400)⚙️ Advanced
const RyuuBotz = makeWASocket({ logger: { level: 'debug' } });RyuuBotz.ws.on('CB:presence', (json) => console.log('Sockets update:', json));
// for any message with tag 'edge_routing'
RyuuBotz.ws.on('CB:edge_routing', (node) => console.log('Sockets update:', node));
// for any message with tag 'edge_routing' and id attribute = abcd
RyuuBotz.ws.on('CB:edge_routing,id:abcd', (node) => console.log('Sockets update:', node));
// for any message with tag 'edge_routing', id attribute = abcd & first content node routing_info
RyuuBotz.ws.on('CB:edge_routing,id:abcd,routing_info', (node) => console.log('Sockets update:', node));⚠️ Disclaimer
This project is not affiliated with WhatsApp/Meta. Use at your own risk.
Refer to WhatsApp's Terms for compliance.
🔗 Full Documentation
Explore all features in the Baileys GitHub Wiki
