I'm trying to send buttons in whatsapp. But it dosent work, no error message tho.
Here's the code:
const fs = require("fs");
const request = require("request");
const uuid = require("uuid");
const qrcode = require("qrcode-terminal");
const {
Client,
LocalAuth,
MessageMedia,
Buttons,
List
} = require("whatsapp-web.js");
const client = new Client({
authStrategy: new LocalAuth(),
});
client.initialize();
client.on("qr", (qr) => {
qrcode.generate(qr, {
small: true
});
});
client.on("authenticated", () => {
console.log("AUTHENTICATED");
});
client.on("ready", () => {
console.log("Client is ready!");
});
client.on("message", async (message) => {
context = message.body;
const buttonList = new Buttons("Hello this is RoboTax, are you here for the first time ?",[{id:"button",body:"button1"},{body:"Button2"}],"RoboTax","Footer")
message.reply(buttonList);
})