Last active
January 4, 2019 13:27
-
-
Save aondio/93a32aa12b4ac179fb25572e5cf186be to your computer and use it in GitHub Desktop.
We have define intent handlers A and B. When intent A is triggered it will return a call to intent B which will eventually handle the rest of the logic
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
//Intent handler A calls intent handler B | |
const A_IntentHandler = { | |
canHandle(handlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'IntentRequest' | |
&& handlerInput.requestEnvelope.request.intent.name === 'A_IntentHandler'; | |
}, | |
handle(handlerInput) { | |
// some code | |
return B_IntentHandler.handle(handlerinput); | |
}, | |
}; | |
//Intent handler B | |
const B_IntentHandler = { | |
canHandle(handlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'IntentRequest' | |
&& handlerInput.requestEnvelope.request.intent.name === 'B_IntentHandler'; | |
}, | |
handle(handlerInput) { | |
// some code | |
return response; | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment