Skip to content

Instantly share code, notes, and snippets.

@Dviejopomata
Last active November 16, 2018 21:56
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 Dviejopomata/88885a7b8cb1f65ad84a1fe44b7a422b to your computer and use it in GitHub Desktop.
Save Dviejopomata/88885a7b8cb1f65ad84a1fe44b7a422b to your computer and use it in GitHub Desktop.
const DatoCuriosoHandler = {
canHandle(handlerInput) {
return (
handlerInput.requestEnvelope.request.type === "IntentRequest" &&
handlerInput.requestEnvelope.request.intent.name === "datoCurioso"
)
},
handle(handlerInput) {
const speechText =
funFactsAboutFormula1[_.random(0, funFactsAboutFormula1.length)]
// "Este es un dato curioso"
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.getResponse()
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment