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

@qadeerxtech/qadeer-btns

v1.0.2

Published

Advanced Baileys interactive buttons wrapper by Team Qadeer

Readme

npm version License

📌 Problem Statement

By default, the @whiskeysockets/baileys library lacks the required binary wrappers (biz, interactive, native_flow) that WhatsApp needs to display interactive buttons. Qadeer-Btns solves this by automatically formatting your buttons and injecting the missing binary nodes seamlessly.

🚀 Key Features

  • ✅ No core edits required in your Baileys folders.
  • ✅ Auto Node Injection (biz, interactive, native_flow).
  • ✅ Full Button Support: Quick Replies, URL CTAs, Copy CTAs, Call CTAs, Lists, and Location sharing.
  • ✅ Media Support: Add images to your button headers (via URL, buffer, or local path).
  • ✅ AI Mode (aimode): Auto-injects the bot node (biz_bot: '1') for advanced conversational AI flows in private chats.
  • ✅ Cross-Chat Support: Works flawlessly in both Private (1:1) and Group chats.

🛠️ Installation

You can install this scoped package using npm, yarn, or bun:

npm install @qadeerxtech/qadeer-btns

Note: Make sure your Baileys version is 7.0.0-rc.2+ and Node.js is 20+.


💻 Usage & Examples

First, require the library in your code:

const { sendButtons, sendInteractiveMessage } = require('@qadeerxtech/qadeer-btns');

1. Basic Quick Replies (The Simple Way)

If you just want to send simple text buttons, qadeer-btns auto-converts basic {id, text} objects into the proper WhatsApp format.

await sendButtons(sock, m.chat, {
  title: '👋 Welcome to Team Qadeer',
  text: 'Please select an option below:',
  footer: 'Powered by Qadeer-Btns',
  image: { url: 'https://example.com/menu-image.jpg' }, // Optional Image
  aimode: true, // Enables AI node for private chats
  buttons: [
    { id: 'btn_ping', text: 'Ping 🏓' },
    { id: 'btn_menu', text: 'View Menu 📜' }
  ]
});

2. Advanced Multi-Type Buttons (URL, Copy, Call)

You can mix different types of Call-To-Action (CTA) buttons in a single message using sendInteractiveMessage.

Note: You must stringify the payload inside buttonParamsJson.

await sendInteractiveMessage(sock, m.chat, {
  text: 'Here are some advanced actions:',
  footer: 'Team Qadeer Tools',
  interactiveButtons: [
    // 1. URL Button
    {
      name: 'cta_url',
      buttonParamsJson: JSON.stringify({
        display_text: 'Visit Our Website 🌐',
        url: 'https://qadeerxtech.com'
      })
    },
    // 2. Copy Code Button
    {
      name: 'cta_copy',
      buttonParamsJson: JSON.stringify({
        display_text: 'Copy Owner Number 📋',
        copy_code: '+923000000000'
      })
    },
    // 3. Tap to Call Button
    {
      name: 'cta_call',
      buttonParamsJson: JSON.stringify({
        display_text: 'Call Support 📞',
        phone_number: '+923000000000'
      })
    }
  ]
});

3. Single Select Lists (Menus)

Want to show a categorized drop-down menu? Use the single_select flow.

await sendInteractiveMessage(sock, m.chat, {
  text: 'Explore our commands below:',
  footer: 'Interactive List Menu',
  interactiveButtons: [
    {
      name: 'single_select',
      buttonParamsJson: JSON.stringify({
        title: 'Tap to Open Menu 📂',
        sections: [
          {
            title: '🛠️ Utility Commands',
            rows: [
              { header: '', title: 'Ping', description: 'Check bot latency', id: 'cmd_ping' },
              { header: '', title: 'Runtime', description: 'Check bot uptime', id: 'cmd_runtime' }
            ]
          },
          {
            title: '🎉 Fun Commands',
            rows: [
              { header: '', title: 'Joke', description: 'Get a random joke', id: 'cmd_joke' },
              { header: '', title: 'Meme', description: 'Get a random meme', id: 'cmd_meme' }
            ]
          }
        ]
      })
    }
  ]
});

4. Send Location Button (Experimental)

Request the user to share their location easily.

await sendInteractiveMessage(sock, m.chat, {
  text: 'Please share your location for delivery:',
  interactiveButtons: [
    { 
      name: 'send_location', 
      buttonParamsJson: JSON.stringify({ 
        display_text: 'Share Location 📍' 
      }) 
    }
  ]
});

🧠 Creating a Helper Function in Your Bot

To keep your bot code clean, you can create a helper function (e.g., lib/kiara_btns.js) just like KIARA MD MINI:

const { sendInteractiveMessage } = require('@qadeerxtech/qadeer-btns');

async function sendKiaraBtns(sock, m, options = {}) {
    const interactiveButtons = options.buttons.map(btn => {
        switch (btn.type) {
            case 'url':
                return { name: 'cta_url', buttonParamsJson: JSON.stringify({ display_text: btn.display_text, url: btn.url }) };
            case 'copy':
                return { name: 'cta_copy', buttonParamsJson: JSON.stringify({ display_text: btn.display_text, copy_code: btn.copy_code }) };
            case 'call':
                return { name: 'cta_call', buttonParamsJson: JSON.stringify({ display_text: btn.display_text, phone_number: btn.phone_number }) };
            case 'list':
                return { name: 'single_select', buttonParamsJson: JSON.stringify({ title: btn.title, sections: btn.sections }) };
            default: // Default is quick_reply
                return { name: 'quick_reply', buttonParamsJson: JSON.stringify({ display_text: btn.display_text, id: btn.id }) };
        }
    });

    let msgOptions = {
        text: options.text,
        footer: options.footer || 'POWERED BY TEAM QADEER',
        interactiveButtons: interactiveButtons
    };

    if (options.image) msgOptions.image = { url: options.image };

    await sendInteractiveMessage(sock, m.chat, msgOptions, { quoted: m });
}

module.exports = { sendKiaraBtns };

🤝 Need Help?

If you find any bugs or have feature requests, feel free to reach out to Team Qadeer!