1.0.1 • Published 11 months ago

wa-bot-template v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

About

Example

//import
const botwa = require("wa-bot-template");

//async funtion; async function fun() { const socket = await botwa("my-bot");

socket.ev.on("messages.upsert", async ({ messages, type }) => { const chat = messages0; const pesan = (chat.message?.extendedTextMessage?.text ?? chat.message?.ephemeralMessage?.message?.extendedTextMessage?.text ?? chat.message?.conversation)?.toLowerCase()||""; const command = pesan.split(" ")0; const args = pesan.split(" ").slice(1).join(" "); console.log(${chat.pushName}: ${pesan});

    switch (command) {
      case ".ping":
        await socket.sendMessage(chat.key.remoteJid, { text: "Hello World." }, { quoted: chat })
        await socket.sendMessage(chat.key.remoteJid, { text: "Hello World2." }) //buat tanpa quoted
        break;
    }

}); }

fun();

1.0.1

11 months ago

1.0.0

11 months ago