This file contains hidden or 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
| // This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). | |
| // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, | |
| // session persistence, api calls, and more. | |
| const Alexa = require('ask-sdk-core'); | |
| const LaunchRequestHandler = { | |
| canHandle(handlerInput) { | |
| return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest'; | |
| }, | |
| handle(handlerInput) { |
This file contains hidden or 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
| // This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). | |
| // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, | |
| // session persistence, api calls, and more. | |
| const Alexa = require('ask-sdk-core'); | |
| const LaunchRequestHandler = { | |
| canHandle(handlerInput) { | |
| return handlerInput.requestEnvelope.request.type === 'LaunchRequest'; | |
| }, | |
| handle(handlerInput) { |
This file contains hidden or 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
| // This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). | |
| // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, | |
| // session persistence, api calls, and more. | |
| const Alexa = require('ask-sdk-core'); | |
| const LaunchRequestHandler = { | |
| canHandle(handlerInput) { | |
| return handlerInput.requestEnvelope.request.type === 'LaunchRequest'; | |
| }, | |
| handle(handlerInput) { |
This file contains hidden or 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
| // This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). | |
| // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, | |
| // session persistence, api calls, and more. | |
| const Alexa = require('ask-sdk-core'); | |
| const persistenceAdapter = require('ask-sdk-s3-persistence-adapter'); | |
| const { | |
| getSlotValue | |
| } = require('ask-sdk-core'); |
This file contains hidden or 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
| // This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). | |
| // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, | |
| // session persistence, api calls, and more. | |
| const Alexa = require('ask-sdk-core'); | |
| const game_data = { | |
| 'cambridge' : 'city', | |
| 'london' : 'capital', | |
| 'england' : 'country', | |
| 'milan' : 'city', |
This file contains hidden or 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
| // This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). | |
| // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, | |
| // session persistence, api calls, and more. | |
| const Alexa = require('ask-sdk-core'); | |
| const fetch = require('node-fetch'); | |
| const LaunchRequestHandler = { | |
| canHandle(handlerInput) { | |
| return handlerInput.requestEnvelope.request.type === 'LaunchRequest'; | |
| }, |
This file contains hidden or 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
| // INTERCEPTOR -- add this in your request interceptor to auto-populate ISPs in your session attributes. | |
| let sessionAttributes = handlerInput.attributesManager.getSessionAttributes() || {}; | |
| if (handlerInput.requestEnvelope.session['new'] || !sessionAttributes.inSkillProducts) { | |
| let inSkillProductArray, persistentAttributes, ispObject; | |
| // first populate ISP info | |
| try { |
This file contains hidden or 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
| /* eslint-disable func-names */ | |
| /* eslint-disable no-console */ | |
| const Alexa = require('ask-sdk'); | |
| const LaunchRequestHandler = { | |
| canHandle(handlerInput) { | |
| const request = handlerInput.requestEnvelope.request; | |
| return request.type === 'LaunchRequest'; | |
| }, |
This file contains hidden or 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
| /* eslint-disable func-names */ | |
| /* eslint-disable no-console */ | |
| const Alexa = require('ask-sdk'); | |
| const ISworeIntentHandler = { | |
| canHandle(handlerInput) { | |
| const request = handlerInput.requestEnvelope.request; | |
| return request.type === 'LaunchRequest' | |
| || (request.type === 'IntentRequest' |
This file contains hidden or 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
| /* eslint-disable func-names */ | |
| /* eslint-disable no-console */ | |
| const Alexa = require('ask-sdk'); | |
| const GetQuoteHandler = { | |
| canHandle(handlerInput) { | |
| const request = handlerInput.requestEnvelope.request; | |
| return request.type === 'LaunchRequest' | |
| || (request.type === 'IntentRequest' |