#Can't send buttons using new Buttons()

10 messages · Page 1 of 1 (latest)

tardy pollen
#

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

untold bronze
#

Buttons are deprecated in this lib.

tardy pollen
untold bronze
#

You can use the official API, but it's not free.

Or maybe you can try find another lib that is able to work with buttons. I don't know if it exists, but you can search someone

tardy pollen
#

Ok thanks for the info

weary rivet
harsh pebble
#

#698625546653007972

potent epoch
weary rivet
#

i think it doesn't work, I've tried it before but it's still the same