Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.