Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Could not send multiple response #320

Open
haward opened this issue Oct 11, 2020 · 0 comments
Open

Could not send multiple response #320

haward opened this issue Oct 11, 2020 · 0 comments

Comments

@haward
Copy link

haward commented Oct 11, 2020

let response = {
'line': {
'type': 'image',
'originalContentUrl': 'https://vision.riverplus.com/wp-content/uploads/2020/01/qrcode.jpg',
'previewImageUrl': 'https://vision.riverplus.com/wp-content/uploads/2020/01/qrcode.jpg'
},
"facebook": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Hello world",
"image_url": "https://vision.riverplus.com/wp-content/uploads/2020/01/qrcode.jpg",
"subtitle": "sub title text",
}
]
}
}
}
}
agent.add(
new Payload(agent.UNSPECIFIED, response, {
rawPayload: true,
sendAsMessage: true,
})
);
agent.add("Select one");
This code will send only the text "Select one"

Need to change parameter agent.UNSPECIFIED to specific channel for example
agent.add(
new Payload('FACEBOOK', response, {
rawPayload: true,
sendAsMessage: true,
})
);
agent.add("Select one");

This code is working.

Question is. Why it doesn't work when using an agent.UNSPECIFIED?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant