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

xibs-btn

v1.0.3

Published

Interactive buttons for Baileys 6.7.x WhatsApp bot

Readme

markdown

xibs-btn

Interactive buttons for Baileys 7.x.x WhatsApp bot

npm version License: MIT

✨ Features

  • 5 Button Types - Quick reply, URL, Copy, Call, and List menus
  • One Simple Function - sendButtons() handles everything
  • Auto Detection - No need to specify button types
  • Image Support - Add images with your buttons
  • Groups & Private Chats - Works everywhere
  • Baileys 7.x.x - Built for latest version

📦 Installation

npm install xibs-btn

🚀 Quick Start

const { sendButtons } = require('xibs-btn');

await sendButtons(sock, jid, {
  text: "Hello! Choose an option:",
  buttons: [
    { text: "Help", id: "help" },
    { text: "About", id: "about" }
  ]
});

📖 Button Types

  1. Quick Reply Button

Sends back the ID when clicked.

{ text: "Yes", id: "answer_yes" }
{ text: "No", id: "answer_no" }
  1. URL Button

Opens a website when clicked.

{ text: "Visit Website", url: "https://example.com" }
{ text: "Documentation", url: "https://docs.example.com" }
  1. Copy Button

Copies text to clipboard.

{ text: "Copy Code", code: "ABC123XYZ" }
{ text: "Get Promo", code: "WELCOME50" }
  1. Call Button

Opens phone dialer.

{ text: "Call Support", number: "+1234567890" }
{ text: "Contact Us", number: "+9876543210" }
  1. List Menu (Single Select)

Dropdown list with multiple options.

{
  title: "Choose Option",
  sections: [
    {
      title: "Main Menu",
      rows: [
        { id: "opt1", title: "Option 1", description: "First choice" },
        { id: "opt2", title: "Option 2", description: "Second choice" }
      ]
    },
    {
      title: "Advanced",
      rows: [
        { id: "opt3", title: "Option 3", description: "Third choice" }
      ]
    }
  ]
}

💡 Examples

Mixed Buttons

await sendButtons(sock, jid, {
  text: "What would you like to do?",
  footer: "Select an action",
  buttons: [
    { text: "Start", id: "start" },
    { text: "Website", url: "https://example.com" },
    { text: "Copy Code", code: "FREE100" },
    { text: "Call Us", number: "+1234567890" }
  ]
});

With Image

await sendButtons(sock, jid, {
  text: "Check out our product!",
  image: "https://example.com/product.jpg",
  buttons: [
    { text: "Buy Now", url: "https://store.com/product" },
    { text: "Save for Later", id: "save" }
  ]
});

List Menu

await sendButtons(sock, jid, {
  text: "Select your preference:",
  buttons: [
    {
      title: "Settings",
      sections: [
        {
          title: "Language",
          rows: [
            { id: "lang_en", title: "English", description: "Switch to English" },
            { id: "lang_es", title: "Spanish", description: "Cambiar a español" }
          ]
        },
        {
          title: "Notifications",
          rows: [
            { id: "notif_on", title: "Enable", description: "Turn on notifications" },
            { id: "notif_off", title: "Disable", description: "Turn off notifications" }
          ]
        }
      ]
    }
  ]
});

Complete Example

const { sendButtons } = require('xibs-btn');

async function sendWelcomeMessage(sock, jid) {
  await sendButtons(sock, jid, {
    text: "🎉 Welcome to our bot!",
    footer: "How can I help you today?",
    image: "https://example.com/welcome.jpg",
    buttons: [
      { text: "📖 Guide", id: "guide" },
      { text: "🌐 Website", url: "https://example.com" },
      { text: "📞 Support", number: "+1234567890" },
      { text: "🎁 Promo", code: "WELCOME50" },
      {
        title: "⚙️ Quick Actions",
        sections: [
          {
            title: "Account",
            rows: [
              { id: "profile", title: "Profile", description: "View your profile" },
              { id: "settings", title: "Settings", description: "Change preferences" }
            ]
          },
          {
            title: "Help",
            rows: [
              { id: "faq", title: "FAQ", description: "Common questions" },
              { id: "contact", title: "Contact", description: "Talk to human" }
            ]
          }
        ]
      }
    ]
  });
}

📚 API Reference

sendButtons(sock, jid, config)

Parameter Type Description sock Object Baileys socket instance jid String WhatsApp JID ([email protected] or [email protected]) config Object Configuration object

Config Object

Field Type Description text String Main message text footer String Optional footer text image String/Buffer/Object Image URL, buffer, or object buttons Array Array of button objects ephemeralExpiration Number Optional disappearing messages duration

Button Object Types

Quick Reply:

{ text: string, id?: string }  // id defaults to text

URL Button:

{ text: string, url: string }

Copy Button:

{ text: string, code: string }

Call Button:

{ text: string, number: string }

List Menu:

{
  title: string,
  sections: [{
    title?: string,
    rows: [{
      id: string,
      title: string,
      description?: string
    }]
  }]
}

🔧 Requirements

· Node.js 20+ · Baileys 7.0.0+

🤝 Contributing

Contributions are welcome! Please open an issue or PR.

📄 License

MIT © xibsx

🌟 Support

· ⭐ Star this repo if you find it useful · 🐛 Report issues on GitHub · 💬 Questions? Open a discussion