Slide 11
Slide 11 text
function onIntent(intentRequest, session, callback) {
var intent = intentRequest.intent,
intentName = intentRequest.intent.name;
// dispatch custom intents to handlers here
if (intentName === 'WiggleIndicator') {
handleWiggleRequest(intent, session, callback, false);
} else if (intentName === 'FailIndicator') {
handleFailRequest(intent, session, callback, false, “");
} else if (intentName === 'AMAZON.YesIntent') {
handleYesRequest(intent, session, callback);
} else if (intentName === 'AMAZON.NoIntent') {
handleNoRequest(intent, session, callback);
} else if (intentName === 'AMAZON.HelpIntent') {
handleHelpRequest(intent, session, callback);
} else if (intentName === 'AMAZON.CancelIntent' || intentName == 'AMAZON.StopIntent') {
handleStopRequest(intent, session, callback);
} else {
throw "Invalid intent";
}
}