dialogflow / dialogflow-fulfillment-nodejs

Dialogflow agent fulfillment library supporting v1&v2, 8 platforms, and text, card, image, suggestion, custom responses
Apache License 2.0
597 stars 282 forks source link

Could not send multiple response #320

Open haward opened 3 years ago

haward commented 3 years ago

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?