由于某些原因,它不想发送按钮,我在网上查找了一下,但没有找到帮助,这是我的代码:
const { Client, LocalAuth ,MessageMedia, Buttons } = require('whatsapp-web.js');
const client = new Client({
authStrategy: new LocalAuth()
});
client.on('qr', qr => {
qrcode.generate(qr, {small: true});
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.on('message', message => {
console.log('message from', message.from)
if (message.body === "!button") {
let button = new Buttons('Button body',[{body:'bt1'},{body:'bt2'},{body:'bt3'}],'title','footer');
client.sendMessage(message.from, button);
}
});
client.initialize();