Created
July 22, 2019 20:45
-
-
Save chatasweetie/d185527c6401b71447b0a43a6aab232a 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
/** | |
* Selects suggestion chips | |
* @param {obj} conv, the conversation object. | |
* @return [] array of suggestion chips. | |
*/ | |
function selectSuggestionChips(conv) { | |
let suggestions = []; | |
for (let i=0; i < conv.data.intentFulfilled.length; i++) { | |
if (conv.data.intentFulfilled[i] === 0) { | |
suggestions.push(responses.SUGGESTIONS['MENU')[i]); | |
} | |
if (suggestions.length === 2) { | |
return suggestions; | |
} | |
} | |
return suggestions; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment