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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ndikz

v26.0.16

Published

baileys Ndikz

Readme

Baileys Modification

📖 Table of Contents


Important Note

The original repository was initially removed by its creator and subsequently taken over by WhiskeySockets. Building upon this foundation, I have implemented several enhancements and introduced new features that were not present in the original repository. These improvements aim to elevate functionality and provide a more robust and versatile experience.

Install

Install in package.json:

"dependencies": {
    "baileys": "npm:baileys-mod"
}

or install in terminal:

npm install baileys@npm:baileys-mod

Then import the default function in your code:

// type esm
import makeWASocket from 'baileys'
// type cjs
const { default: makeWASocket } = require("baileys")

Added Features and Improvements

| Feature | Description | | :------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------- | | 💬 Send Messages to Channels | Supports sending text and media messages to channels. | | 🔘 Button & Interactive Messages | Supports sending button messages and interactive messages on WhatsApp Messenger and WhatsApp Business. | | 🤖 AI Message Icon | Customize message appearances with an optional AI icon, adding a modern touch. | | 🖼️ Full-Size Profile Pictures | Allows users to upload profile pictures in their original size without cropping, ensuring better quality and visual presentation. | | 🔑 Custom Pairing Codes | Users can now create and customize pairing codes as they wish, enhancing convenience and security when connecting devices. | | 🛠️ Libsignal Fixes | Enjoy a cleaner development experience with refined logs, providing more informative and less cluttered output from the libsignal library. |

More features and improvements will be added in the future.

Feature Examples

Here are some examples of features that have been added:

Newsletter Management

  • To get info newsletter
const metadata = await sock.newsletterMetadata("invite", "xxxxx")
// or
const metadata = await sock.newsletterMetadata("jid", "abcd@newsletter")
console.log(metadata)
  • To update the description of a newsletter
await sock.newsletterUpdateDescription("abcd@newsletter", "New Description")
  • To update the name of a newsletter
await sock.newsletterUpdateName("abcd@newsletter", "New Name")
  • To update the profile picture of a newsletter
await sock.newsletterUpdatePicture("abcd@newsletter", buffer)
  • To remove the profile picture of a newsletter
await sock.newsletterRemovePicture("abcd@newsletter")
  • To mute notifications for a newsletter
await sock.newsletterUnmute("abcd@newsletter")
  • To mute notifications for a newsletter
await sock.newsletterMute("abcd@newsletter")
  • To create a newsletter
const metadata = await sock.newsletterCreate("Newsletter Name", "Newsletter Description")
console.log(metadata)
  • To delete a newsletter
await sock.newsletterDelete("abcd@newsletter")
  • To follow a newsletter
await sock.newsletterFollow("abcd@newsletter")
  • To unfollow a newsletter
await sock.newsletterUnfollow("abcd@newsletter")
  • To send reaction
// jid, id message & emoticon
// way to get the ID is to copy the message url from channel
// Example: [ https://whatsapp.com/channel/xxxxx/175 ]
// The last number of the URL is the ID
const id = "175"
await sock.newsletterReactMessage("abcd@newsletter", id, "🥳")

Button and Interactive Message Management

  • To send button with text
const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

const buttonMessage = {
    text: "Hi it's button message",
    footer: 'Hello World',
    buttons,
    headerType: 1,
    viewOnce: true
}

await sock.sendMessage(id, buttonMessage, { quoted: null })
  • To send button with image
const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

const buttonMessage = {
    image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
    caption: "Hi it's button message with image",
    footer: 'Hello World',
    buttons,
    headerType: 1,
    viewOnce: true
}

await sock.sendMessage(id, buttonMessage, { quoted: null })
  • To send button with video
const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

const buttonMessage = {
    video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
    caption: "Hi it's button message with video",
    footer: 'Hello World',
    buttons,
    headerType: 1,
    viewOnce: true
}

await sock.sendMessage(id, buttonMessage, { quoted: null })
  • To send interactive message
const interactiveButtons = [
     {
        name: "quick_reply",
        buttonParamsJson: JSON.stringify({
             display_text: "Quick Reply",
             id: "ID"
        })
     },
     {
        name: "cta_url",
        buttonParamsJson: JSON.stringify({
             display_text: "Tap Here!",
             url: "https://www.example.com/"
        })
     },
     {
        name: "cta_copy",
        buttonParamsJson: JSON.stringify({
             display_text: "Copy Code",
             id: "12345",
             copy_code: "12345"
        })
     }
]

const interactiveMessage = {
    text: "Hello World!",
    title: "this is the title",
    footer: "this is the footer",
    interactiveButtons
}

await sock.sendMessage(id, interactiveMessage, { quoted: null })
  • To send interactive message with image
const interactiveButtons = [
     {
        name: "quick_reply",
        buttonParamsJson: JSON.stringify({
             display_text: "Quick Reply",
             id: "ID"
        })
     },
     {
        name: "cta_url",
        buttonParamsJson: JSON.stringify({
             display_text: "Tap Here!",
             url: "https://www.example.com/"
        })
     },
     {
        name: "cta_copy",
        buttonParamsJson: JSON.stringify({
             display_text: "Copy Code",
             id: "12345",
             copy_code: "12345"
        })
     }
]

const interactiveMessage = {
    image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
    caption: "this is the caption",
    title: "this is the title",
    footer: "this is the footer",
    interactiveButtons
}

await sock.sendMessage(id, interactiveMessage, { quoted: null })
  • To send interactive message with video
const interactiveButtons = [
     {
        name: "quick_reply",
        buttonParamsJson: JSON.stringify({
             display_text: "Quick Reply",
             id: "ID"
        })
     },
     {
        name: "cta_url",
        buttonParamsJson: JSON.stringify({
             display_text: "Tap Here!",
             url: "https://www.example.com/"
        })
     },
     {
        name: "cta_copy",
        buttonParamsJson: JSON.stringify({
             display_text: "Copy Code",
             id: "12345",
             copy_code: "12345"
        })
     }
]

const interactiveMessage = {
    video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
    caption: "this is the caption",
    title: "this is the title",
    footer: "this is the footer",
    interactiveButtons
}

await sock.sendMessage(id, interactiveMessage, { quoted: null })

AI Message Icon Customization

// To enable the AI icon for a message, simply add the "ai: true" parameter:
await sock.sendMessage(id, { text: "Hello World", ai: true });

Custom Pairing Code Generation

if(usePairingCode && !sock.authState.creds.registered) {
    const phoneNumber = await question('Please enter your mobile phone number:\n');
    // Define your custom 8-digit code (alphanumeric)
    const customPairingCode = "NSTRCODE";
    const code = await sock.requestPairingCode(phoneNumber, customPairingCode);
    console.log(`Your Pairing Code: ${code?.match(/.{1,4}/g)?.join('-') || code}`);
}

Note: The question function is a placeholder for your method of obtaining user input.

Reporting Issues

If you encounter any issues while using this repository or any part of it, please feel free to open a new issue here.

Notes

Everything other than the modifications mentioned above remains the same as the original repository. You can check out the original repository at WhiskeySockets