【发布时间】:2021-03-17 07:22:25
【问题描述】:
我正在使用whatsapp-web.js 发送和回复消息。 https://github.com/pedroslopez/whatsapp-web.js
我可以使用以下代码连接和回复消息:
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();
如何在whatsapp中向手机号码发送新消息??
【问题讨论】:
标签: javascript node.js whatsapp