Skip to content

Instantly share code, notes, and snippets.

@rmtuckerphx
Last active December 6, 2018 19:09
Show Gist options
  • Save rmtuckerphx/4c5b4ef78c7fd52ea05109418876b96f to your computer and use it in GitHub Desktop.
Save rmtuckerphx/4c5b4ef78c7fd52ea05109418876b96f to your computer and use it in GitHub Desktop.
Alexa Champion Tip 1
{
"interactionModel": {
"languageModel": {
"invocationName": "champion tip",
"types": [
],
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": [
]
},
{
"name": "AMAZON.HelpIntent",
"samples": [
]
},
{
"name": "AMAZON.StopIntent",
"samples": [
"goodbye"
]
}
]
}
}
}
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)
.getResponse();
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment