Skip to content

ZeativeLabs/starter-zaileys

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter Kit for Zaileys Library Simplified WhatsApp Node.js

Starter Kit for Zaileys Library Simplified WhatsApp Node.js

GitHub License Discord GitHub Stars GitHub Forks GitHub Watchers

starter-zaileys is a robust and ready-to-use template for building WhatsApp automation bots using the Zaileys library. It comes pre-configured with essential features, best practices, and a modular structure to help you kickstart your project immediately.


Discord


🛠️ Prerequisites

  • Node.js: Version 20 or higher.
  • npm or pnpm: Package manager.

📦 Installation

  1. Clone the repository:

    git clone https://github.com/zeative/starter-zaileys.git
    cd starter-zaileys
  2. Install dependencies:

    npm install
    # or
    pnpm install

🚀 Usage

Development

Run the bot in development mode with hot-reloading:

npm run dev

Production

Start the bot in production mode:

npm start

💡 Code Example

Here's a quick look at how to initialize the client and handle messages:

import { Client } from "zaileys";

const wa = new Client({
  authType: "qr",

  fakeReply: {
    provider: "chatgpt",
  },
});

// Middleware to prevent spam
wa.use(async (ctx, next) => {
  if (ctx.messages.isSpam) {
    return await wa.send(ctx.messages.roomId, "Don't spam!");
  }
  await next();
});

// Handle incoming messages
wa.on("messages", async (ctx) => {
  if (ctx.text === ".ping") {
    await wa.send(ctx.roomId, "Pong!");
  }
});

🎯 Issues & Feedback

If you encounter any problems or have feature requests, please open an issue

📜 License

Distributed under the MIT License. See LICENSE for details.

About

Starter Kit for Zaileys Library Simplified WhatsApp Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%