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

@znan/wabot

v0.0.101

Published

Simple Functions WhatsApp Bot

Downloads

20,799

Readme

@ZNAN/WABOT - Baileys WhatsApp Bot Module

NPM Version NPM Downloads License: MIT

ℹ️ Introduction

Welcome to @ZNAN/WABOT! This module, built upon the robust Baileys library, offers a streamlined, elegant, and easy-to-understand approach to developing your own WhatsApp bots. It's designed for developers seeking an efficient way to build and deploy WhatsApp bot scripts.

✨ Key Features

  • Simplified Baileys Integration: Leverage the power of Baileys with a more user-friendly interface.
  • Flexible Configuration: Extensive options to tailor your bot's behavior.
  • Efficient Session Management: Robust handling of connection sessions.
  • Comprehensive Event Handling: Supports various Baileys events for bot responsiveness.
  • Developer-Centric Design: Built with ease of use and learning in mind.

🔰 Installation

Install the module using npm or yarn:

Using npm:

npm install @znan/wabot

Using yarn:

yarn add @znan/wabot

🔌 Connection

Here's an example of how to initialize your bot connection:

// Import the module
const { Connection } = require('@znan/wabot'); // or import { Connection } from '@znan/wabot';

// Initialize connection with options
const Conn = new Connection({
   plugins_dir: 'plugins',      // Directory for your bot plugins
   session_dir: 'session',      // Directory for session data
   online: true,                // Set bot presence to online
   presence: true,              // Send presence updates
   bypass_ephemeral: true,      // Bypass ephemeral messages (if supported)
   pairing: {
      state: true,              // Enable pairing mode (QR code scan)
      number: 6283175395970,    // Your phone number (optional, for automatic pairing)
      code: 'MOONXBOT'          // Unique code for your session (optional)
   }
}, {
   browser: ['Ubuntu', 'Firefox', '20.0.00'], // Simulated browser info
   version: [2, 3000, 1029030078],         // Simulated Baileys version
   shouldIgnoreJid: jid => {               // Function to ignore specific JIDs (e.g., newsletters, other bots)
      return /(newsletter|bot)/.test(jid);
   }
});

💡 Usage (Event Handling)

Once connected, you can listen for various events. Here's a sample of common event handlers:

// Handle connection event
Conn.on('connect', () => {
   console.log('Bot connected successfully!');
   // Implement actions after connection, e.g., broadcast messages
});

// Handle connection errors
Conn.on('error', (error) => {
   console.error('Connection error:', error);
});

// Handle bot preparation state
Conn.on('prepare', () => {
   console.log('Bot is preparing...');
});

// Handle message updates (incoming/outgoing)
Conn.on('messages.update', (messageUpdate) => {
   // console.log('Message update:', messageUpdate);
   // Process incoming messages here or in a dedicated handler
});

// Handle message reactions
Conn.on('messages.reaction', (reaction) => {
   console.log('Message reaction:', reaction);
});

// Handle message receipts (read status)
Conn.on('messages.receipt', (receipt) => {
   console.log('Message received:', receipt);
});

// Handle deleted messages
Conn.on('messages.delete', (deletedMessage) => {
   console.log('Message deleted:', deletedMessage);
});

// Handle presence updates
Conn.on('presence.update', (presenceUpdate) => {
   // console.log('Presence update:', presenceUpdate);
});

// Handle story updates (if supported)
Conn.on('stories', (stories) => {
   console.log('Stories update:', stories);
});

// Handle group participant updates
Conn.on('group-participants.update', (groupUpdate) => {
   console.log('Group participants updated:', groupUpdate);
});

// Handle group information updates
Conn.on('groups.update', (groupInfoUpdate) => {
   console.log('Group info updated:', groupInfoUpdate);
});

// Handle call information
Conn.on('call', (callInfo) => {
   console.log('Call info:', callInfo);
});

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed with dedication by Znan.