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.38k stars 3.67k forks source link

bug buttons not work #1945

Closed IgalNeeman closed 1 year ago

IgalNeeman commented 1 year ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

buttons not work

Describe the solution you'd like.

not work in chrome and chromuim no buttons in msg

Describe an alternate solution.

When I press !buttons exactly like in the file it doesn't work it says it sent the buttons but it doesn't send attached pictures of the bug and you don't see the text on the screen

your original code:

image

when i press !buttons

image

the result is:

image

but i cant see the buttos no replay from the bot.

nother msg working ok please help me

Additional context

No response

Ridtt commented 1 year ago

@IgalNeeman Im sorry enchancement? Messages containing buttons just not sent (main goal of chat is sending and receiving messages), how is this a "enchancement"?

IgalNeeman commented 1 year ago

hi, i want to send buttons choline in the chat how can i do this work? can you fix this? thank you

‫בתאריך שבת, 21 בינו׳ 2023 ב-12:01 מאת ‪Ridtt‬‏ @.*** ‬‏>:‬

@IgalNeeman https://github.com/IgalNeeman Im sorry enchancement? Messages with buttons just not sent (main goal of chat is sending and receiving messages), how is this a "enchancement"?

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1399220390, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4HPXBFFWHIOE5BWPYTWTOXYFANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

Ridtt commented 1 year ago

@IgalNeeman Im currenly using this solution. Waiting for this be merged into release. https://github.com/pedroslopez/whatsapp-web.js/issues/1938#issuecomment-1397982452

IgalNeeman commented 1 year ago

i do npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list in the folder of my project, and i run node example.js i write !buttons and it not working.

‫בתאריך שבת, 21 בינו׳ 2023 ב-13:15 מאת ‪Ridtt‬‏ @.*** ‬‏>:‬

@IgalNeeman https://github.com/IgalNeeman #1938 (comment) https://github.com/pedroslopez/whatsapp-web.js/issues/1938#issuecomment-1397982452

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1399231195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4AQVCNFHNRV77XCPD3WTPAORANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

elhumbertoz commented 1 year ago

Somebody have fixed this problem?

KikeDeAlba commented 1 year ago

Somebody have fixed this problem?

You can solve it with these steps:

Run npm remove whatsapp-web.js Add "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" to the dependencies inside package.json Run npm i Go to node_modules\whatsapp-web.js\src\util\Injected.js Comment out line 16 like this: // window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures;

Done, you should be able to use the buttons and list

IgalNeeman commented 1 year ago

hello thank you about the mail to fix the issue let me to check if its work this the steps that i do :

first i do 1 npm remove ... 2 i do again npm i github:.....fx buttons .. 3 i do

i do npm i and i do

[image: image.png]

[image: image.png] save ctrl+s

run the puppeteer and check if its working ? yes or not ?

its not working the msg saty like the same msg.

[image: image.png]

‫בתאריך יום ב׳, 23 בינו׳ 2023 ב-14:14 מאת ‪KikeDeAlba‬‏ <‪ @.***‬‏>:‬

You can solve it with these steps:

Run npm remove whatsapp-web.js Add "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" to the dependencies inside package.json Run npm i Go to node_modules\whatsapp-web.js\src\util\Injected.js Comment out line 16 like this: // window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures;

Done, you should be able to use the buttons

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1400246316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4HQIVEWEZEMPWG6GG3WTZY3JANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

IgalNeeman commented 1 year ago

image

matheuspbmarques commented 1 year ago

Somebody have fixed this problem?

You can solve it with these steps:

Run npm remove whatsapp-web.js Add "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" to the dependencies inside package.json Run npm i Go to node_modules\whatsapp-web.js\src\util\Injected.js Comment out line 16 like this: // window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures;

Done, you should be able to use the buttons and list

Thanks for help me.

IgalNeeman commented 1 year ago

@matheuspbmarques matheuspbmarques

i do all you'r steps what you write for me and its not working

Axe7bravo commented 1 year ago

"whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list"

@IgalNeeman that's because line 16 @matheuspbmarques is saying you should comment out is actually line 359 to 362, once you comment out that block of code it should work as intended.

IgalNeeman commented 1 year ago

@Axe7bravo I DO commet out and it not work.

image

Axe7bravo commented 1 year ago

@IgalNeeman I think the problem is because you're commenting out the wrong block of code.

Do this:

Step 1: CTRL + F: search for "window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures"

Step 2: Comment out whatever you find with that search term.

then it should work.

IgalNeeman commented 1 year ago

HI I DO THIS AND ITS NOT WORK!!!!!!!!!!!!!!!!!

‫בתאריך יום ו׳, 3 בפבר׳ 2023 ב-15:28 מאת ‪Axe7 Bravo‬‏ <‪ @.***‬‏>:‬

That's because you're commenting out the wrong block of code.

Do this:

Step 1: CTRL + F: search for "window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures"

Step 2: Comment out whatever you find with that search term.

then it should work.

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1415871644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4GROABD4JYBPL3F54DWVUBZBANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

Axe7bravo commented 1 year ago

@IgalNeeman then I don't know where you're going wrong because I followed @matheuspbmarques steps then searched for that term and commented it out and the buttons and list started working.

matheuspbmarques commented 1 year ago

@matheuspbmarques matheuspbmarques

i do all you'r steps what you write for me and its not working

Sorry my daley. Do it.

Step 1 - Run npm uninstall whatsapp-web.js Step 2 - Run npm install whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list Step 3 - Find node_modules\whatsapp-web.js\src\util\Injected.js Step 4 - In file "Injected.js" comment in line 16;

helio2323 commented 1 year ago

@IgalNeeman ,

I had the same problem, I managed to solve it this way.

I recommend deleting the whatsapp-web.js folder to start the walkthrough from the beginning

  1. Install Git - https://git-scm.com/download/win

  2. Launch Git CMD

  3. Set the installation mass

  4. Use the command git clone https://github.com/pedroslopez/whatsapp-web.js.git

  5. Use the command npm install --no-audit

  6. Use the command npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list

  7. Go to whatsapp-web.js\node_modules\whatsapp-web.js and copy the "src" folder

  8. Paste the files from the "src" folder in C:\whatsapp-web.js

  9. Run the example.js file with the command node example.js or node example

After doing this, you can test that it will work, I had the same problem as you and this way it worked.

IgalNeeman commented 1 year ago

@helio2323 Hi thank you alot, i do all the steps that you tell me and its not work.

image

IgalNeeman commented 1 year ago

hi its not work =[

‫בתאריך יום א׳, 5 בפבר׳ 2023 ב-22:32 מאת ‪Helio Fernandes dos Reis Lima‬‏ <‪ @.***‬‏>:‬

@IgalNeeman https://github.com/IgalNeeman

Eu estava com o mesmo problema, consegui resolver dessa maneira.

Recomendo deletar a pasta whatsapp-web.js para iniciar o passo a passo do inicio

1- instale o Git - https://git-scm.com/download/win 2- Inicie o Git CMD 3- Defina a pasta de instalação 4- Use o comando git clone https://github.com/pedroslopez/whatsapp-web.js.git 5- Use o comando npm install --no-audit 6- Use o comando npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list 7- Vá até whatsapp-web.js\node_modules\whatsapp-web.js e copie a pasta "src" 8- Cole os arquivos da pasta "src" em C:\whatsapp-web.js

Depois de fazer isso pode testar que vai funcionar, eu estava com o mesmo problema que você.

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1418257777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4C4UYUUXXEKEGOQGXDWWAE4DANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

vendroid12 commented 1 year ago

create

hi its not work =[ ‫בתאריך יום א׳, 5 בפבר׳ 2023 ב-22:32 מאת ‪Helio Fernandes dos Reis Lima‬‏ <‪ @.‬‏>:‬ @IgalNeeman https://github.com/IgalNeeman Eu estava com o mesmo problema, consegui resolver dessa maneira. Recomendo deletar a pasta whatsapp-web.js para iniciar o passo a passo do inicio 1- instale o Git - https://git-scm.com/download/win 2- Inicie o Git CMD 3- Defina a pasta de instalação 4- Use o comando git clone https://github.com/pedroslopez/whatsapp-web.js.git 5- Use o comando npm install --no-audit 6- Use o comando npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list 7- Vá até whatsapp-web.js\node_modules\whatsapp-web.js e copie a pasta "src" 8- Cole os arquivos da pasta "src" em C:\whatsapp-web.js Depois de fazer isso pode testar que vai funcionar, eu estava com o mesmo problema que você. — Reply to this email directly, view it on GitHub <#1945 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4C4UYUUXXEKEGOQGXDWWAE4DANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.>

create a new folder. open your terminal and paste this code

npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list npm install qrcode-terminal( to scan qr code from terminal).

buttons should work.

Axe7bravo commented 1 year ago

@IgalNeeman post screenshots of the steps, because we can't help you if we can't see what you're doing, or better yet upload the folder to GitHub so we can clone it and take a look.

IgalNeeman commented 1 year ago

npm install qrcode-terminal

the qr code i can only scan it in browser, i install what you tell me, but cant scan qr code in terminal :<

maybe someone can connect to my pc with anydesk ?

IgalNeeman commented 1 year ago

now its work. closed thank you/

‫בתאריך יום ג׳, 7 בפבר׳ 2023 ב-20:29 מאת ‪Axe7 Bravo‬‏ <‪ @.***‬‏>:‬

@IgalNeeman https://github.com/IgalNeeman post screenshots of the steps, because we can't help you if we can't see what you're doing, or better yet upload the folder to GitHub so we can clone it and take a look.

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1421258942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4FI4ZP4MWNJH5RSYNTWWKIA3ANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

IgalNeeman commented 1 year ago

its work, closed

[image: image.png]

‫בתאריך יום ג׳, 7 בפבר׳ 2023 ב-23:10 מאת ‪igal neeman‬‏ <‪ @.***‬‏>:‬

now its work. closed thank you/

‫בתאריך יום ג׳, 7 בפבר׳ 2023 ב-20:29 מאת ‪Axe7 Bravo‬‏ <‪ @.***‬‏>:‬

@IgalNeeman https://github.com/IgalNeeman post screenshots of the steps, because we can't help you if we can't see what you're doing, or better yet upload the folder to GitHub so we can clone it and take a look.

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1421258942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4FI4ZP4MWNJH5RSYNTWWKIA3ANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

mauriciopfl commented 1 year ago

Don't work for me, I'm using ^1.19.4, I have tried all suggested alternatives. The only difference is that I'm using yarn, so I used the command: yarn remove whatsapp-web.js yarn add https://github.com/pedroslopez/whatsapp-web.js#fix-buttons-list

image

matheuspbmarques commented 1 year ago

Don't work for me, I'm using ^1.19.4, I have tried all suggested alternatives. The only difference is that I'm using yarn, so I used the command: yarn remove whatsapp-web.js yarn add https://github.com/pedroslopez/whatsapp-web.js#fix-buttons-list

image

Hi. Wassup?

Follow this steps:

1 - Run: npm install whatsapp-web.js | yarn add whatsapp-web.js 2 - Run: rm node_modules (this will remove node_modules folder) 3 - In you file package.json, you'll see you package "whatsapp-web.js", change number version to github:pedroslopez/whatsapp-web.js#fix-buttons-list

See: "dependencies": { "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" }

4 - Run: npm install | yarn install 5 - Find file "Injected.js" in node_modules\whatsapp-web.js\src\util\Injected.js 6 - In file "Injected.js" comment in line 16;

Tell me if fixed you;

KernelHub commented 1 year ago

For me it works, but it is not displayed on mobile phone? Any suggestion to see buttons and lists on phone?

matheuspbmarques commented 1 year ago

For me it works, but it is not displayed on mobile phone? Any suggestion to see buttons and lists on phone?

You follow? https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1441951167

gustavomanso commented 1 year ago

I don't get an error message, but the button doesn't reach the recipient

gustavomanso commented 1 year ago

For me it works, but it is not displayed on mobile phone? Any suggestion to see buttons and lists on phone?

You follow? #1945 (comment)

For me doesn't sent button

matheuspbmarques commented 1 year ago

For me it works, but it is not displayed on mobile phone? Any suggestion to see buttons and lists on phone?

You follow? #1945 (comment)

For me doesn't sent button

You follow my last reply? Follow last, and return me

mauriciopfl commented 1 year ago

Don't work for me, I'm using ^1.19.4, I have tried all suggested alternatives. The only difference is that I'm using yarn, so I used the command: yarn remove whatsapp-web.js yarn add https://github.com/pedroslopez/whatsapp-web.js#fix-buttons-list image

Hi. Wassup?

Follow this steps:

1 - Run: npm install whatsapp-web.js | yarn add whatsapp-web.js 2 - Run: rm node_modules (this will remove node_modules folder) 3 - In you file package.json, you'll see you package "whatsapp-web.js", change number version to github:pedroslopez/whatsapp-web.js#fix-buttons-list

See: "dependencies": { "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" }

4 - Run: npm install | yarn install 5 - Find file "Injected.js" in node_modules\whatsapp-web.js\src\util\Injected.js 6 - In file "Injected.js" comment in line 16;

Tell me if fixed you;

line 16 contains the following content: image

Is she the one who needs to be commented on?

Anyway, unfortunately it still didn't solve the problem. The lib informs that it was sent successfully, but the buttons do not reach the recipient

Follow puppeteer browser error image

mauriciopfl commented 1 year ago

``

Don't work for me, I'm using ^1.19.4, I have tried all suggested alternatives. The only difference is that I'm using yarn, so I used the command: yarn remove whatsapp-web.js yarn add https://github.com/pedroslopez/whatsapp-web.js#fix-buttons-list image

Hi. Wassup? Follow this steps: 1 - Run: npm install whatsapp-web.js | yarn add whatsapp-web.js 2 - Run: rm node_modules (this will remove node_modules folder) 3 - In you file package.json, you'll see you package "whatsapp-web.js", change number version to github:pedroslopez/whatsapp-web.js#fix-buttons-list See: "dependencies": { "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" } 4 - Run: npm install | yarn install 5 - Find file "Injected.js" in node_modules\whatsapp-web.js\src\util\Injected.js 6 - In file "Injected.js" comment in line 16; Tell me if fixed you;

line 16 contains the following content: image

Is she the one who needs to be commented on?

Anyway, unfortunately it still didn't solve the problem. The lib informs that it was sent successfully, but the buttons do not reach the recipient

Follow puppeteer browser error image

Message object successfully created:


{
  "_data": {
    "id": {
      "fromMe": true,
      "remote": "xxxxxxxxxxxxx@c.us",
      "id": "3EB0FAE28F1A634A7450",
      "self": "out",
      "_serialized": "true_xxxxxxxxxxxxx@c.us_3EB0FAE28F1A634A7450_out"
    },
    "body": "you want?",
    "type": "chat",
    "t": 1677204789,
    "from": "xxxxxxxxxxxxx@c.us",
    "to": "xxxxxxxxxxxxx@c.us",
    "self": "out",
    "ack": 0,
    "isNewMsg": true,
    "star": false,
    "kicNotified": false,
    "caption": "you want?",
    "isFromTemplate": false,
    "title": "title test",
    "pollInvalidated": false,
    "isSentCagPollCreation": false,
    "latestEditMsgKey": null,
    "latestEditSenderTimestampMs": null,
    "mentionedJidList": [],
    "groupMentions": [],
    "footer": "footer test",
    "isVcardOverMmsDocument": false,
    "isForwarded": false,
    "hasReaction": false,
    "productHeaderImageRejected": false,
    "lastPlaybackProgress": 0,
    "isDynamicReplyButtonsMsg": true,
    "dynamicReplyButtons": [
      {
        "buttonId": "0",
        "buttonText": {
          "displayText": "Yes"
        },
        "type": 1
      },
      {
        "buttonId": "1",
        "buttonText": {
          "displayText": "No"
        },
        "type": 1
      }
    ],
    "isMdHistoryMsg": false,
    "stickerSentTs": 0,
    "isAvatar": false,
    "requiresDirectConnection": null
  },
  "id": {
    "fromMe": true,
    "remote": "xxxxxxxxxxxxx@c.us",
    "id": "3EB0FAE28F1A634A7450",
    "self": "out",
    "_serialized": "true_xxxxxxxxxxxxx@c.us_3EB0FAE28F1A634A7450_out"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "you want?",
  "type": "chat",
  "timestamp": 1677204789,
  "from": "xxxxxxxxxxxxx@c.us",
  "to": "xxxxxxxxxxxxx@c.us",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "title": "title test",
  "dynamicReplyButtons": [
    {
      "buttonId": "0",
      "buttonText": {
        "displayText": "Yes"
      },
      "type": 1
    },
    {
      "buttonId": "1",
      "buttonText": {
        "displayText": "No"
      },
      "type": 1
    }
  ]
}

But the recipient does not receive the message
:(
matheuspbmarques commented 1 year ago

Tell me in WhatsApp +5591993140809

IgalNeeman commented 1 year ago

Hello, i have questions:

How can i do that with the bot whatsapp (export chat data) like the button that i have i whatsapp, So i would like a command to explort the log bot with the user Somthing like this Please any help me

בתאריך יום שישי, 24 בפברואר 2023, מאת Matheus Pereira Baia Marques < @.***>:

Tell me in WhatsApp +5591993140809

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1442710896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4GTOVY6IPVX7Q25KNDWZAMR5ANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

gustavomanso commented 1 year ago

For me it works, but it is not displayed on mobile phone? Any suggestion to see buttons and lists on phone?

You follow? #1945 (comment)

For me doesn't sent button

You follow my last reply? Follow last, and return me

Yes, I followed the steps exactly and it didn't work.

gustavomanso commented 1 year ago

``

Don't work for me, I'm using ^1.19.4, I have tried all suggested alternatives. The only difference is that I'm using yarn, so I used the command: yarn remove whatsapp-web.js yarn add https://github.com/pedroslopez/whatsapp-web.js#fix-buttons-list image

Hi. Wassup? Follow this steps: 1 - Run: npm install whatsapp-web.js | yarn add whatsapp-web.js 2 - Run: rm node_modules (this will remove node_modules folder) 3 - In you file package.json, you'll see you package "whatsapp-web.js", change number version to github:pedroslopez/whatsapp-web.js#fix-buttons-list See: "dependencies": { "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list" } 4 - Run: npm install | yarn install 5 - Find file "Injected.js" in node_modules\whatsapp-web.js\src\util\Injected.js 6 - In file "Injected.js" comment in line 16; Tell me if fixed you;

line 16 contains the following content: image Is she the one who needs to be commented on? Anyway, unfortunately it still didn't solve the problem. The lib informs that it was sent successfully, but the buttons do not reach the recipient Follow puppeteer browser error image

Message object successfully created:

{
  "_data": {
    "id": {
      "fromMe": true,
      "remote": "xxxxxxxxxxxxx@c.us",
      "id": "3EB0FAE28F1A634A7450",
      "self": "out",
      "_serialized": "true_xxxxxxxxxxxxx@c.us_3EB0FAE28F1A634A7450_out"
    },
    "body": "you want?",
    "type": "chat",
    "t": 1677204789,
    "from": "xxxxxxxxxxxxx@c.us",
    "to": "xxxxxxxxxxxxx@c.us",
    "self": "out",
    "ack": 0,
    "isNewMsg": true,
    "star": false,
    "kicNotified": false,
    "caption": "you want?",
    "isFromTemplate": false,
    "title": "title test",
    "pollInvalidated": false,
    "isSentCagPollCreation": false,
    "latestEditMsgKey": null,
    "latestEditSenderTimestampMs": null,
    "mentionedJidList": [],
    "groupMentions": [],
    "footer": "footer test",
    "isVcardOverMmsDocument": false,
    "isForwarded": false,
    "hasReaction": false,
    "productHeaderImageRejected": false,
    "lastPlaybackProgress": 0,
    "isDynamicReplyButtonsMsg": true,
    "dynamicReplyButtons": [
      {
        "buttonId": "0",
        "buttonText": {
          "displayText": "Yes"
        },
        "type": 1
      },
      {
        "buttonId": "1",
        "buttonText": {
          "displayText": "No"
        },
        "type": 1
      }
    ],
    "isMdHistoryMsg": false,
    "stickerSentTs": 0,
    "isAvatar": false,
    "requiresDirectConnection": null
  },
  "id": {
    "fromMe": true,
    "remote": "xxxxxxxxxxxxx@c.us",
    "id": "3EB0FAE28F1A634A7450",
    "self": "out",
    "_serialized": "true_xxxxxxxxxxxxx@c.us_3EB0FAE28F1A634A7450_out"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "you want?",
  "type": "chat",
  "timestamp": 1677204789,
  "from": "xxxxxxxxxxxxx@c.us",
  "to": "xxxxxxxxxxxxx@c.us",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "title": "title test",
  "dynamicReplyButtons": [
    {
      "buttonId": "0",
      "buttonText": {
        "displayText": "Yes"
      },
      "type": 1
    },
    {
      "buttonId": "1",
      "buttonText": {
        "displayText": "No"
      },
      "type": 1
    }
  ]
}

But the recipient does not receive the message
:(

This happens to me too. I am using whatsapp business.

mi-mazouz commented 1 year ago

@matheuspbmarques It works for me but only if the app is open on the conversation otherwise the message is not received

amiruldev20 commented 1 year ago

its work?

asqrzk commented 1 year ago

Not being sent to android client

IgalNeeman commented 1 year ago

Hi buttins stop working at all.

בתאריך שבת, 15 באפר׳ 2023, 11:39, מאת asqrzk @.***>:

Not being sent to android client

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1509643031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4DJE3RDZV4O4E2DOETXBJNEDANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

IgalNeeman commented 1 year ago

Hi Buttins + list stop working..

בתאריך שבת, 15 באפר׳ 2023, 13:07, מאת igal neeman @.***>:

Hi buttins stop working at all.

בתאריך שבת, 15 באפר׳ 2023, 11:39, מאת asqrzk @.***>:

Not being sent to android client

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1509643031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4DJE3RDZV4O4E2DOETXBJNEDANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

IgalNeeman commented 1 year ago

Bottons +list stop working

בתאריך שבת, 15 באפר׳ 2023, 13:07, מאת igal neeman @.***>:

Hi Buttins + list stop working..

בתאריך שבת, 15 באפר׳ 2023, 13:07, מאת igal neeman @.***

:

Hi buttins stop working at all.

בתאריך שבת, 15 באפר׳ 2023, 11:39, מאת asqrzk @.***>:

Not being sent to android client

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/1945#issuecomment-1509643031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCZ4DJE3RDZV4O4E2DOETXBJNEDANCNFSM6AAAAAAUAPYYTI . You are receiving this because you were mentioned.Message ID: @.***>

TaffarelXavier commented 1 year ago

Not work june/2023.

Ubuntu: 18.04
Node: v16.20.1
NPM: 8.19.4

My Code:

const qrcode = require('qrcode-terminal');

const { Client, Buttons } = require('whatsapp-web.js');

const client = new Client();

client.on('qr', qr => {
    qrcode.generate(qr, {small: true});
});

client.on('ready', () => {
    console.log('Client is ready!');
});

client.on('message', message => {
    if(message.body === 'ping') {
        let button = new Buttons('Button body', [{ body: 'Aceptar' }, { body: 'rechazar' }], 'title', 'footer');
        client.sendMessage(message.from, button);
    }
});

client.initialize();

package.json:

{
  "name": "whatsapp-web",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "node index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cors": "^2.8.5",
    "express": "^4.18.2",
    "npm": "^9.7.2",
    "qrcode-terminal": "^0.12.0",
    "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list"
  }
}

Following file: node_modules/whatsapp-web.js/src/util/Injected.js

Screenshot_20230625_031248

MastayY commented 1 year ago

Not work june/2023.

Ubuntu: 18.04
Node: v16.20.1
NPM: 8.19.4

My Code:

const qrcode = require('qrcode-terminal');

const { Client, Buttons } = require('whatsapp-web.js');

const client = new Client();

client.on('qr', qr => {
    qrcode.generate(qr, {small: true});
});

client.on('ready', () => {
    console.log('Client is ready!');
});

client.on('message', message => {
  if(message.body === 'ping') {
        let button = new Buttons('Button body', [{ body: 'Aceptar' }, { body: 'rechazar' }], 'title', 'footer');
      client.sendMessage(message.from, button);
  }
});

client.initialize();

package.json:

{
  "name": "whatsapp-web",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "node index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cors": "^2.8.5",
    "express": "^4.18.2",
    "npm": "^9.7.2",
    "qrcode-terminal": "^0.12.0",
    "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#fix-buttons-list"
  }
}

Following file: node_modules/whatsapp-web.js/src/util/Injected.js

Screenshot_20230625_031248

yeah bro me too, no error but not receive the button

SuarezJF commented 1 year ago

Hi, I am very new at this, and i have been trying to set up a bot, and use buttons on it. Couldn't make it. I tried others providers and also have problems. Somebody mentioned in other thread.that whatsapp blocked messages containing that kind of content..

Hope this can be reverted.