Skip to content

Instantly share code, notes, and snippets.

@leoaiassistant
Last active August 3, 2020 08:22
Show Gist options
  • Select an option

  • Save leoaiassistant/33f71dda4a2f1697b0571ba260d25d2f to your computer and use it in GitHub Desktop.

Select an option

Save leoaiassistant/33f71dda4a2f1697b0571ba260d25d2f to your computer and use it in GitHub Desktop.
const CancelAndStopIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
const speechText = 'Goodbye!';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Hello World', speechText)
.withShouldEndSession(true)
.getResponse();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment