Secreto31126/whatsapp-api-js

How send button messages?

arivanbastos opened this issue · 1 comments

Hi,

I'm sorry but I couldn't find a clear example of how to send button messages using the lib.
Considering it is a very common feature in automated chats, would it be possible to add a line of code to the main example (readme.md) showing how to work with buttons?

I'm planning on adding a TUTORIALS folder with some examples for each message type. I already started writting a few of the examples in a private file, so it shouldn't take too long to do.

Here's the Interactive with buttons example:

const interactive_button_message = new Interactive(
    new ActionButtons(
        new Button("hello", "Hello"),
        new Button("world", "World")
    ),
    new Body("Hello World") // Mandatory Body
    // Optional Header of any type
    // Optional Footer
);

Interactive docs: https://whatsappapijs.web.app/classes/messages.Interactive.html
ActionButtons docs: https://whatsappapijs.web.app/classes/messages.ActionButtons.html