Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template messages with Buttons #39

Closed
andersondeoliveiramachado opened this issue Feb 7, 2020 · 12 comments
Closed

Template messages with Buttons #39

andersondeoliveiramachado opened this issue Feb 7, 2020 · 12 comments
Labels
enhancement New feature or request

Comments

@andersondeoliveiramachado
Copy link
Contributor

andersondeoliveiramachado commented Feb 7, 2020

image

image

https://wa.me/5511955705173?text=Ol%C3%A1,%20UAM

image

is there any possibility and implementation of this function?

@aliyss
Copy link
Collaborator

aliyss commented Feb 7, 2020

Nice one. I will look into it.

@andersondeoliveiramachado
Copy link
Contributor Author

andersondeoliveiramachado commented Feb 7, 2020

in another project here at git, some progress has been made with this type of message. But it seems that whatsapp blocks when it is sent to.

https://github.com/smashah/sulla/blob/82ee145b9d83222aa506ff3bfc72a9aacd9164da/src/lib/wapi.js#L1692

@pedroslopez
Copy link
Owner

pedroslopez commented Feb 8, 2020

Oh wow this is really interesting. Will definitely look In to this as well!

@pedroslopez pedroslopez added the enhancement New feature or request label Feb 8, 2020
@pedroslopez pedroslopez changed the title New type message Template messages Feb 8, 2020
@andersondeoliveiramachado
Copy link
Contributor Author

template_button.txt

[
{
"id": {
"fromMe": false,
"remote": "5511955705173@c.us",
"id": "91875E65606A66D4EA",
"_serialized": "false_5511955705173@c.us_91875E65606A66D4EA"
},
"body": "Confirma para mim o seu nome completo: menu principal, está correto(a)?",
"type": "template",
"subtype": "text",
"t": 1580956051,
"notifyName": "",
"from": "5511955705173@c.us",
"to": "5511933995164@c.us",
"self": "in",
"ack": 0,
"invis": true,
"star": false,
"caption": "Confirma para mim o seu nome completo: menu principal, está correto(a)?",
"broadcast": false,
"mentionedJidList": [],
"buttons": [
{
"id": "0",
"displayText": "Sim, está correto(a)",
"subtype": "quick_reply",
"selectionId": "{"eventName":"yes"}"
},
{
"id": "1",
"displayText": "Não, quero corrigir",
"subtype": "quick_reply",
"selectionId": "{"eventName":"no"}"
}
],
"isForwarded": false,
"labels": []
},
{
"id": {
"fromMe": false,
"remote": "5511955705173@c.us",
"id": "96BA2DB14292993A26",
"_serialized": "false_5511955705173@c.us_96BA2DB14292993A26"
},
"body": "Para continuar precisamos de algumas informações.\nGostaria de informar os dados ou enviar uma foto da CNH/RG e nós coletamos os dados da imagem da CNH/RG?",
"type": "template",
"subtype": "text",
"t": 1580944973,
"notifyName": "",
"from": "5511955705173@c.us",
"to": "5511933995164@c.us",
"self": "in",
"ack": 0,
"invis": true,
"star": false,
"caption": "Para continuar precisamos de algumas informações.\nGostaria de informar os dados ou enviar uma foto da CNH/RG e nós coletamos os dados da imagem da CNH/RG?",
"broadcast": false,
"mentionedJidList": [],
"buttons": [
{
"id": "0",
"displayText": "Informar dados",
"subtype": "quick_reply",
"selectionId": "{"eventName":"inform"}"
},
{
"id": "1",
"displayText": "Enviar foto RG",
"subtype": "quick_reply",
"selectionId": "{"eventName":"event-rg"}"
},
{
"id": "2",
"displayText": "Enviar foto CNH",
"subtype": "quick_reply",
"selectionId": "{"eventName":"event-cnh"}"
}
],
"isForwarded": false,
"labels": []
},
{
"id": {
"fromMe": true,
"remote": "5511955705173@c.us",
"id": "3EB023CE6F1611ADA489",
"_serialized": "true_5511955705173@c.us_3EB023CE6F1611ADA489"
},
"body": "Informar dados",
"type": "template_button_reply",
"t": 1580945117,
"notifyName": "",
"from": "5511933995164@c.us",
"to": "5511955705173@c.us",
"self": "in",
"ack": 2,
"invis": true,
"star": false,
"quotedMsg": {
"type": "chat",
"body": "Para continuar precisamos de algumas informações.\nGostaria de informar os dados ou enviar uma foto da CNH/RG e nós coletamos os dados da imagem da CNH/RG?"
},
"quotedStanzaID": "96BA2DB14292993A26",
"quotedParticipant": "5511955705173@c.us",
"mentionedJidList": [],
"selectedId": "{"eventName":"inform"}",
"selectedIndex": 0,
"labels": []
},
{
"id": {
"fromMe": true,
"remote": "5511955705173@c.us",
"id": "3EB092A0BDF2B11FFF60",
"_serialized": "true_5511955705173@c.us_3EB092A0BDF2B11FFF60"
},
"body": "Enviar foto RG",
"type": "template_button_reply",
"t": 1580956019,
"notifyName": "",
"from": "5511933995164@c.us",
"to": "5511955705173@c.us",
"self": "in",
"ack": 2,
"invis": true,
"star": false,
"quotedMsg": {
"type": "chat",
"body": "Para continuar precisamos de algumas informações.\nGostaria de informar os dados ou enviar uma foto da CNH/RG e nós coletamos os dados da imagem da CNH/RG?"
},
"quotedStanzaID": "96BA2DB14292993A26",
"quotedParticipant": "5511955705173@c.us",
"mentionedJidList": [],
"selectedId": "{"eventName":"event-rg"}",
"selectedIndex": 1,
"labels": []
}
]

@andersondeoliveiramachado andersondeoliveiramachado changed the title Template messages Template messages with Buttons Mar 1, 2020
@iamshouvikmitra
Copy link

Any further developments? Really excited to get this one!

@byeze
Copy link

byeze commented May 20, 2020

I would love to have this!

@esteves67
Copy link

esteves67 commented Aug 5, 2020

Those messages with buttons looks awesome! Hope we can use that in this library in the future!

Edit:
As said on open-wa library, this feature is impossible to have at the moment, because it needs WhatsApp Oficial API (paid) to use those buttons, so its a feature that whatsapp doesn't permit normal business users to use, only those business accounts that pay alot of money to have the official api.
open-wa/wa-automate-nodejs#98

@PurpShell
Copy link
Sponsor Collaborator

As of now, you can only view messages in buttons (msg.buttons), each button has it's own ID and the button layout itself has to be verified by whatsapp moderators before being assigned an ID.

Closing this issue, you are welcome to open it again if you think this was done in error.

Links:

Best regards,

PurpShell

@ghost

This comment has been minimized.

@PurpShell
Copy link
Sponsor Collaborator

The thing you are referring to is not relevant here, the advance they made is in a legacy version of the template message, called a button message. those are two different things, though they might seem similar. #756 has done this greatly so far, if that's what you wish for.

@roysG
Copy link

roysG commented Jan 31, 2022

So how do this library allow the template buttons with regular/business whatsapp?

https://github.com/adiwajshing/Baileys

@antoniocesar16
Copy link

Very nicee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants