WhatsApp-LP was created with the purpose of demonopolizing the automation of chatbots and e-commerce in my city, allowing anyone to create
one.
The project is still under development, please report any errors or bugs to us.
Installation
Install the plugin from npm:
npm install -D whatsapp-lp
Basic Usage
To start creating
a bot
, follow the code below:
const whatsapp = require('whatsapp-lp');
whatsapp.create({
session: 'whatsapp-lp', // Name of session
headless: false,
logQR: true,
})
.then((client) => {
start(client);
});
async function start(client) {
client.onMessage(async (message) => {
if (message.content === "!ping") {
// Reply
await client.reply(message.from, `Pong! 🏓`, message.id)
// Send Text
await client.sendText(message.from, `Pong! 🏓`);
}
});
}
Using the WhatsApp-LP
methods, it is possible to create a handler for text commands, images, audios, stickers, among others, these codes will be available on our GitHub.
License
whatsapp-lp
is licensed under the MIT License.
To view example codes Visit Project GitHub