New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@ravliesh/baileys

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ravliesh/baileys

WhatsApp API Modification By Ravel

latest
npmnpm
Version
1.0.2
Version published
Weekly downloads
4
-82.61%
Maintainers
1
Weekly downloads
 
Created
Source

Thumbnail

Version NodeJS Author License

Complete, copy-paste-ready snippets for every modern WhatsApp message type you can send through the Baileys library.
Replace placeholder values (jid, m, image URLs, button labels, etc.) with your own and run.

1. New version support @lid

2. Socket Bootstrap

import makeWASocket, { DisconnectReason, fetchLatestBaileysVersion, useMultiFileAuthState, } from "@whiskeysockets/baileys"; import { Boom } from "@hapi/boom";

async function startSock() { const { state, saveCreds } = await useMultiFileAuthState("auth_info"); const { version, isLatest } = await fetchLatestBaileysVersion(); console.log(Using WA v${version.join(".")}, isLatest: ${isLatest});

const sock = makeWASocket({ version, logger: P({ level: "silent" }), printQRInTerminal: true, auth: state, });

sock.ev.on("creds.update", saveCreds);

sock.ev.on("connection.update", (update) => { const { connection, lastDisconnect } = update; if (connection === "close") { const shouldReconnect = (lastDisconnect?.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut; console.log("Connection closed due to ", lastDisconnect?.error, ", reconnecting ", shouldReconnect); if (shouldReconnect) startSock(); } else if (connection === "open") { console.log("Socket opened"); } });

return sock; }

Add Function ( Simple code )

Check ID Channel

Get ID channel

await sock.newsletterId(url)

Newsletter Reaction Mode Channel

Reaction Channel

await sock.newsletterReactMessage(
 "12345678910@newsletter",
  "155",
  "🔥"
);

Newsletter Create Channel

Create Channel

await sock.newsletterCreate("Nama Channels");

SendMessage Documentation

Status Group Message V2

Send group status with version 2

await sock.sendMessage(jid, {
     groupStatusMessage: {
          text: "Hello World"
     }
});

Album Message (Multiple Images)

Send multiple images in a single album message:

await sock.sendMessage(jid, { 
    albumMessage: [
        { image: cihuy, caption: "Foto pertama" },
        { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
    ] 
}, { quoted: m });

Event Message

Create and send WhatsApp event invitations:

await sock.sendMessage(jid, { 
    eventMessage: { 
        isCanceled: false, 
        name: "Hello World", 
        description: "rav native", 
        location: { 
            degreesLatitude: 0, 
            degreesLongitude: 0, 
            name: "rowrrrr" 
        }, 
        joinLink: "https://call.whatsapp.com/video/ravel", 
        startTime: "1763019000", 
        endTime: "1763026200", 
        extraGuestsAllowed: false 
    } 
}, { quoted: m });

Poll Result Message

Display poll results with vote counts:

await sock.sendMessage(jid, { 
    pollResultMessage: { 
        name: "Hello World", 
        pollVotes: [
            {
                optionName: "TEST 1",
                optionVoteCount: "112233"
            },
            {
                optionName: "TEST 2",
                optionVoteCount: "1"
            }
        ] 
    } 
}, { quoted: m });

Simple Interactive Message

Send basic interactive messages with copy button functionality:

await sock.sendMessage(jid, {
    interactiveMessage: {
        header: "Hello World",
        title: "Hello World",
        footer: "telegram: @ravel ",
        buttons: [
            {
                name: "cta_copy",
                buttonParamsJson: JSON.stringify({
                    display_text: "copy code",
                    id: "123456789",              
                    copy_code: "ABC123XYZ"
                })
            }
        ]
    }
}, { quoted: m });

Interactive Message with Native Flow

Send interactive messages with buttons, copy actions, and native flow features:

await sock.sendMessage(jid, {    
    interactiveMessage: {      
        header: "Hello World",
        title: "Hello World",      
        footer: "telegram: @ravel",      
        image: { url: "https://example.com/image.jpg" },      
        nativeFlowMessage: {        
            messageParamsJson: JSON.stringify({          
                limited_time_offer: {            
                    text: "idk hummmm?",            
                    url: "https://t.me/ravel",            
                    copy_code: "rav",            
                    expiration_time: Date.now() * 999          
                },          
                bottom_sheet: {            
                    in_thread_buttons_limit: 2,            
                    divider_indices: [1, 2, 3, 4, 5, 999],            
                    list_title: "rav native",            
                    button_title: "rav native"          
                },          
                tap_target_configuration: {            
                    title: " X ",            
                    description: "bomboclard",            
                    canonical_url: "https://t.me/ravel",            
                    domain: "shop.example.com",            
                    button_index: 0          
                }        
            }),        
            buttons: [          
                {            
                    name: "single_select",            
                    buttonParamsJson: JSON.stringify({              
                        has_multiple_buttons: true            
                    })          
                },          
                {            
                    name: "call_permission_request",            
                    buttonParamsJson: JSON.stringify({              
                        has_multiple_buttons: true            
                    })          
                },          
                {            
                    name: "single_select",            
                    buttonParamsJson: JSON.stringify({              
                        title: "Hello World",              
                        sections: [                
                            {                  
                                title: "title",                  
                                highlight_label: "label",                  
                                rows: [                    
                                    {                      
                                        title: "@ravel",                      
                                        description: "love you",                      
                                        id: "row_2"                    
                                    }                  
                                ]                
                            }              
                        ],              
                        has_multiple_buttons: true            
                    })          
                },          
                {            
                    name: "cta_copy",            
                    buttonParamsJson: JSON.stringify({              
                        display_text: "copy code",              
                        id: "123456789",              
                        copy_code: "ABC123XYZ"            
                    })          
                }        
            ]      
        }    
    }  
}, { quoted: m });

For complete documentation, installation guides, and implementation examples, please visit the official repository and community forums. We continually update and improve this library to meet the needs of developers and users of modern WhatsApp automation solutions.

Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!

Keywords

whatsapp

FAQs

Package last updated on 31 Dec 2025

Related posts