orkestral / venom

Venom is a high-performance system developed with JavaScript to create a bot for WhatsApp, support for creating any interaction, such as customer service, media sending, sentence recognition based on artificial intelligence and all types of design architecture for WhatsApp.
https://orkestral.io
Apache License 2.0
6k stars 1.16k forks source link

sendButton not working #2114

Closed AndisKush closed 1 year ago

AndisKush commented 1 year ago

Description

Usando o código da documentação

const buttons = [ { "buttonText": { "displayText": "Text of Button 1" } }, { "buttonText": { "displayText": "Text of Button 2" } } ] await client.sendButtons('000000000000@c.us', 'Title', buttons, 'Description') .then((result) => { console.log('Result: ', result); //return object success }) .catch((erro) => { console.error('Error when sending: ', erro); //return object error });

O result:

Result: { me: {}, to: { fromMe: true, remote: { server: 'c.us', user: '553488354011', _serialized: '553488354011@c.us' }, id: '3EB0CCF2210FACEA1D69', _serialized: 'true_553488354011@c.us_3EB0CCF2210FACEA1D69' }, erro: false, text: null, status: 'OK', result: null, type: 'Buttons', dynamicReplyButtons: [ { buttonText: [Object] }, { buttonText: [Object] } ] }

Mas a mensagem não aparece no WhatsApp

image

Environment

Additional context / Screenshot

Add any other context about the problem here. If applicable, add screenshots to help explain.

github-actions[bot] commented 1 year ago

Thank you for joining our community, happy. We are currently fixing this bug, our new version will be released soon.

Working with Love!

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

karein commented 1 year ago

Hello, i'm having the same problem

the function doesn't return an error, I receive the notification but I don't received the message. After calling the button function, the chat messages disappear, and I can't see any new messages sent to that chat.

I tested multidevice: true/false with both, business and personal account.

Environment

screenshots

i'm using the documentation code: const buttons = [{ "buttonText": { "displayText": "Text of Button 1" }}, { "buttonText": { "displayText": "Text of Button 2" }}] await client.sendButtons('xxxxxxxxxxxx@c.us', 'title', buttons, 'description')
.then((result) => { console.log('Result: ', result); //return object success }) .catch((erro) => { console.error('Error when sending: ', erro); //return object error });

Result: { me: {}, to: { fromMe: true, remote: { server: 'c.us', user: 'xxxxxxxxxxxx', _serialized: 'xxxxxxxxxxxx@c.us' }, id: 'XXXXXXXXXXXXXXXXXXXX', _serialized: 'true_xxxxxxxxxxxx@c.us_XXXXXXXXXXXXXXXXXXXX' }, erro: false, text: null, status: 'OK', result: null, type: 'Buttons', dynamicReplyButtons: [ { buttonText: [Object] }, { buttonText: [Object] } ] }

Divino67 commented 1 year ago

Same problem here!

serobalino commented 1 year ago

The solution is simple, the example is wrong. It should look like this:

[
    {
        url: 'https://orkestral.io/',
        text: 'Orkestral Cloud'
    }, {
        phoneNumber: '+55 11 91438-0641',
        text: 'Suporte Orkestral'
    }, {
        id: '1',
        text: 'Button 1'
    }
]

But it's still wrong because alone, the 'text' attribute works, the rest doesn't work

karein commented 1 year ago

The solution is simple, the example is wrong. It should look like this:

[
    {
        url: 'https://orkestral.io/',
        text: 'Orkestral Cloud'
    }, {
        phoneNumber: '+55 11 91438-0641',
        text: 'Suporte Orkestral'
    }, {
        id: '1',
        text: 'Button 1'
    }
]

But it's still wrong because alone, the 'text' attribute works, the rest doesn't work

it works out for me, at least the buttons are showing 👍

marlon33 commented 1 year ago

The solution is simple, the example is wrong. It should look like this:

[
    {
        url: 'https://orkestral.io/',
        text: 'Orkestral Cloud'
    }, {
        phoneNumber: '+55 11 91438-0641',
        text: 'Suporte Orkestral'
    }, {
        id: '1',
        text: 'Button 1'
    }
]

But it's still wrong because alone, the 'text' attribute works, the rest doesn't work

It doesn't work for me, can you show the code please?? Whatsapp business??

serobalino commented 1 year ago
let buttons = [
    {
        url: 'https://orkestral.io/',
        text: 'Prueba de link'
    }, {
        phoneNumber: '+55 11 91438-0641',
        text: 'Suporte Orkestral'
    }, {
        id: '1',
        text: 'Button 1'
    }
];
client.sendButtons("xxxxxxxxxxxx@c.us", "Title", buttons, "Description")
guh0rzd commented 1 year ago

You can try this: let buttons = [ { "id": "1", "text": "Text 1", },

{
  "id": "2",
  "text": "Text 2",
  },

];

This format is working in 4.3.7 version

marlon33 commented 1 year ago

Sorry

let buttons = [
    {
        url: 'https://orkestral.io/',
        text: 'Prueba de link'
    }, {
        phoneNumber: '+55 11 91438-0641',
        text: 'Suporte Orkestral'
    }, {
        id: '1',
        text: 'Button 1'
    }
];
client.sendButtons("xxxxxxxxxxxx@c.us", "Title", buttons, "Description")

It doesn't work here 4.3.7,

    let buttons = [
        {
            url: 'https://orkestral.io/',
            text: 'Prueba de link'
        }, {
            phoneNumber: '+55 11 91438-0641',
            text: 'Suporte Orkestral'
        }, {
            id: '1',
            text: 'Button 1'
        }
    ]
    client.sendButtons(numberMarlon, 'Title', buttons, 'Description')
        .then((result) => {
            console.log('Result: ', result); //return object success
        })
        .catch((erro) => {
            console.error('Error when sending: ', erro); //return object error
        });

Whtas that was sent image

Whats that was recived image

tapan-thapa commented 1 year ago

I am the facing the same issue being faced by @marlon33.

yuryalencar commented 1 year ago

The same BUG in the Brazilian context

The sendButton method is working only for São Paulo (SP) DDD numbers for me.

// São Paulo DDD number
const spNumber = 5511XXXXXXXXX@c.us // sendButton working for sender and receiver

But when I change the phone number to another Brazilian DDD like GO/RS/PA/MA ... doesn't work. The messages are sent but the WhatsApp sends to the same number but not Whatsapp. When I try to call the number I receive the respective message: "This number doesn't have WhatsApp"

The sender's perspective (With number):

image

But the real conversation is (With contact name):

image
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

SahilAggarwal2004 commented 1 year ago

Any solutions to this issue?