I am using whatsapp-web.js to send and reply message. https://github.com/pedroslopez/whatsapp-web.js
I can connect and reply message using following code:
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();
how can I send new message in whatsapp to mobile number??