Created
January 23, 2020 09:17
-
-
Save PamornT/80f9dbc98d6617ec43674e18b293fac9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const structjson = require('./structjson'); | |
const intentResponseMessage = intentResponse.queryResult.fulfillmentMessages | |
const replyMessage = intentResponseMessage.map( (messageObj) => { | |
let struct | |
if (messageObj.message === "text") { | |
return {type: "text", text: messageObj.text.text[0] } | |
} else if(messageObj.message === "payload") { | |
struct = messageObj.payload | |
return structjson.structProtoToJson(struct) | |
} | |
return null | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment