Skip to content

Instantly share code, notes, and snippets.

@chatasweetie
Created July 2, 2018 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chatasweetie/ec14d117ae7005cb8a99e79084ea3b64 to your computer and use it in GitHub Desktop.
Save chatasweetie/ec14d117ae7005cb8a99e79084ea3b64 to your computer and use it in GitHub Desktop.
//index.js
app.intent('solution', (conv) => {
let message = choose(responses.solutions)[0];
// if the user doesn't have a screen, give them only the
// message plus info about getting url via a screen
if (!conv.screen){
conv.ask(message['text'] + ' To see the url switch ' +
'over to a screen');
return;
}
conv.ask(new SimpleResponse({
speech: message['hintSpeech'],
text: message['hintText'],
}));
// creates a card with a photo and a link
conv.ask(new BasicCard({
title: 'Github Repo',
buttons: new Button({
title: 'Go to Solution',
url: github + challengesName + '/' + challengesName +
'.md',
}),
image: new Image({
url: celebrationImg,
alt: 'Image of balloons or fireworks',
}),
}));
conv.ask(new Suggestions('Solution', 'Repeat Problem')
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment