Skip to content

Commit

Permalink
fix: Fixed buttons for non beta user
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Sep 9, 2024
1 parent 22b2072 commit fbbf094
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/chat/functions/prepareMessageButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
createFanoutMsgStanza,
createMsgProtobuf,
encodeMaybeMediaType,
getABPropConfigValue,
mediaTypeFromProtobuf,
typeAttributeFromProtobuf,
} from '../../whatsapp/functions';
Expand Down Expand Up @@ -401,4 +402,13 @@ webpack.onFullReady(() => {

return node;
});

wrapModuleFunction(getABPropConfigValue, (func, ...args) => {
const [key] = args;
switch (key) {
case 'web_unwrap_message_for_stanza_attributes':
return false;
}
return func(...args);
});
});

6 comments on commit fbbf094

@ariona
Copy link

@ariona ariona commented on fbbf094 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button message is not sent.

// Send interactive button
WPP.chat.sendTextMessage('[email protected]', 'Hello', {
  useInteractiveMessage: true, // False for legacy
  buttons: [
    {
      url: 'https://google.com/',
      text: 'Google Site'
    },
    {
      phoneNumber: '+6281224631231',
      text: 'Call me'
    },
  ],
  title: 'Title text', // Optional
  footer: 'Footer text' // Optional
});

// Send quick reply button
WPP.chat.sendTextMessage('[email protected]', 'Hello', {
  useInteractiveMessage: true, // False for legacy
  buttons: [
    {
      id: 'your custom id 1',
      text: 'Custom button'
    },
  ],
  title: 'Title text', // Optional
  footer: 'Footer text' // Optional
});

WA Version: Version 2.3000.1016489592

Screenshot 2024-09-14 at 08 53 41 Screenshot 2024-09-14 at 08 55 59

@ariona
Copy link

@ariona ariona commented on fbbf094 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i clicked the red button, and resend text. the message is sent. But on the recipient phone it only show regular message content only not the title, footer & button

@marcelo386
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/wppconnect-team/wa-js/releases/tag/v3.10.1

WPP.chat.sendTextMessage('[email protected]', 'Hello', {
createChat: true,
buttons: [
{
url: 'https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code_expiration_minutes=10&code=otp881320',
text: 'Copiar'
},
{
url: 'https://wppconnect.io/',
text: 'WPPConnect Site'
},
],
title: 'Title text', // Optional
footer: 'Footer text' // Optional
});

@ariona
Copy link

@ariona ariona commented on fbbf094 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/wppconnect-team/wa-js/releases/tag/v3.10.1

WPP.chat.sendTextMessage('[email protected]', 'Hello', { createChat: true, buttons: [ { url: 'https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code_expiration_minutes=10&code=otp881320', text: 'Copiar' }, { url: 'https://wppconnect.io/', text: 'WPPConnect Site' }, ], title: 'Title text', // Optional footer: 'Footer text' // Optional });

Screenshot 2024-09-14 at 09 27 21

@ariona
Copy link

@ariona ariona commented on fbbf094 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that for otp code button 😳 ... this would be awesome if worked

@ariona
Copy link

@ariona ariona commented on fbbf094 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/wppconnect-team/wa-js/releases/tag/v3.10.1

WPP.chat.sendTextMessage('[email protected]', 'Hello', { createChat: true, buttons: [ { url: 'https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code_expiration_minutes=10&code=otp881320', text: 'Copiar' }, { url: 'https://wppconnect.io/', text: 'WPPConnect Site' }, ], title: 'Title text', // Optional footer: 'Footer text' // Optional });

After trying to sent it to regular whatsapp, i see this is working.

But sending it to whatsapp bussiness number is not working.

Please sign in to comment.