early-train-33247
03/12/2024, 1:54 AMjs
"contacts": [...],
"messages": [
{
"context": {
"from": "bot_phone",
"id": "wamid=="
},
"from": "user_phone",
"id": "wamid",
"timestamp": "1710204778",
"type": "button",
"button": {
"payload": "Update alert",
"text": "Update alert"
}
}
]
And the subsequential logs:
Received button message from Whatsapp: { payload: 'Update alert', text: 'Update alert' }
This is how I send the template buttons 👇early-train-33247
03/12/2024, 1:56 AMjs
{
"message": {
"whatsapp:id": "wamid"
},
"conversation": {
"whatsapp:userPhone": "user_phone",
"whatsapp:phoneNumberId": "phone_id"
},
"user": {
"whatsapp:userId": "user_id",
"whatsapp:name": "Guilhermy"
}
}
Having a message["whatsapp:contextId"]
tag would be a nice solution (for this use case and others) because I would be able to find the exact message that the user clicked (replied) and get the related info! Just like we have in the slack integration with slack:threadId
Appreciate any suggestions!limited-pencil-78283
03/13/2024, 7:31 AMlimited-pencil-78283
03/13/2024, 7:31 AMearly-train-33247
03/13/2024, 8:15 PMbiz_opaque_callback_data
from event.payload but that property is not made available by Botpress. That would be a solution indeed
.early-train-33247
03/13/2024, 9:47 PMReceived button message from Whatsapp: { payload: 'cancel_alert_13', text: 'Cancel alert' }
Printing event.payload
right after that returns {"text":"Cancel alert"}
That means the payload is not being forwarded, which is the case for buttons in Captures and Cards
.early-train-33247
03/13/2024, 9:47 PMfamous-zoo-73118
03/15/2024, 4:32 PMearly-train-33247
03/15/2024, 5:21 PMfamous-zoo-73118
03/15/2024, 5:57 PMearly-train-33247
03/15/2024, 6:49 PMearly-train-33247
03/15/2024, 6:49 PMearly-train-33247
03/15/2024, 6:49 PMfamous-zoo-73118
03/15/2024, 7:55 PMearly-train-33247
03/15/2024, 8:21 PMearly-train-33247
03/15/2024, 8:23 PMevent
, looks like a bug tbh
- The simplest workaround to get the alert id would be using biz_opaque_callback_data
, but the handler doesn't forward it
- And the last solution would be getting the id of the message that was replied to, which requires saving the ids to be found later which is cumbersome but doable, but we don't have access to that variable eitherearly-train-33247
03/15/2024, 8:27 PMearly-train-33247
03/15/2024, 8:28 PMfamous-zoo-73118
03/16/2024, 1:01 AMevent.tags.message['whatsapp:id']
early-train-33247
03/19/2024, 2:57 AMslack:threadId
. I wanted to access it as a workaround to finding the alertfamous-zoo-73118
03/19/2024, 2:11 PMmessages[0].context.id
in a conversation tag (e.g. "whatsapp::contextId") would be feasible. If you want to create a pull request with this change I'd be happy to bring attention to it so it's reviewed sooner 🙂famous-zoo-73118
03/19/2024, 2:12 PMearly-train-33247
03/23/2024, 2:20 AMearly-train-33247
04/19/2024, 9:15 PMearly-train-33247
04/19/2024, 9:15 PMearly-train-33247
04/19/2024, 9:16 PMbiz_opaque_callback_data
available in the payload when the user interacts with a carouselearly-train-33247
04/25/2024, 6:06 PMfamous-zoo-73118
04/25/2024, 6:33 PMfamous-zoo-73118
04/25/2024, 6:35 PM