Created
July 2, 2018 22:58
-
-
Save chatasweetie/ec14d117ae7005cb8a99e79084ea3b64 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
//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