Skip to content

Instantly share code, notes, and snippets.

@aondio
Last active January 4, 2019 13:27
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 aondio/93a32aa12b4ac179fb25572e5cf186be to your computer and use it in GitHub Desktop.
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
//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