pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.08k stars 3.59k forks source link

sending buttons don't work #1707

Closed Shaharbad closed 1 year ago

Shaharbad commented 1 year ago

Is there an existing issue for this?

Describe the bug

when I tried to send a button it didn't send it for some reason.

Expected behavior

it should've sent the button

Steps to Reproduce the Bug or Issue

checkout my code

Relevant Code

heres my code: const qrcode = require('qrcode-terminal');

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();

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Windows Phone OS: iOS whatsapp-web.js version ^1.17.1

Additional context

No response

kleitofi commented 1 year ago

hello i have the same problem how did you answer?

RafaelIngenium commented 1 year ago

hello i have the same problem how did you answer?