I need to trigger an event when a person has received the link of a bot.This bot is going to send a specific message but the event has to be when the person clicks a link, because this library has events like when the it is ready, when it receives a message. Please let me understand how to use this library because I am new to using javascript libraries. Of course I already made the connection and it is recieving messages pretty well.
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => {
// Generate and scan this code with your phone
console.log('QR RECEIVED', qr);
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.on('message', msg => {
if (msg.body == '!ping') {
msg.reply('pong');
}
});
client.initialize();