Created
May 9, 2018 16:52
-
-
Save memodoring/fef7f07e7e5681d3ed692187399e2115 to your computer and use it in GitHub Desktop.
A sample handle for the Alexa SDK V2 for Node.js
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
handle(handlerInput) { | |
const factArr = data; | |
const factIndex = Math.floor(Math.random() * factArr.length); | |
const randomFact = factArr[factIndex]; | |
const speechOutput = GET_FACT_MESSAGE + randomFact; | |
return handlerInput.responseBuilder | |
.speak(speechOutput) | |
.withSimpleCard(SKILL_NAME, randomFact) | |
.getResponse(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment