Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// index.js
app.intent('askProblem', (conv, params) => {
let level = params.level;
// if level is random or not defined, I choose a random level
if (level === 'random' || !level) {
let keys = Object.keys(response.challenges);
level = choose(keys);
}
let questions = responses.challenge[level];
let message = choose(questions)[0];
conv.ask(new SimpleResponse({
speech: message['speech'],
text: message['text'],
}));
// provides suggestion chips for visual displays
conv.ask(new Suggestions('Hint', 'Solution'));
});
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.