0
AlexaSkill.prototype.eventHandlers = {
    OnSessionStarted: function(sessionStartedRequest, session){
    },
    OnLaunch: function(launchRequest, session, response){
     throw: "OnLaunch should be overriden by subclass";
     },
    OnIntent: function(intentRequest, session, response){
       var intent = intentRequest.intent,
           intentName = intenRequest.intent.name,
           intentHandler = this.intentHandler(intentName);
    if (intentHandler){
        console.log('dispatch intent =' + intenRequest);
        intentHandl.ercall(this,intent, session,session);
    } else {
        throw 'Unsupported intent =' + intenName;
    }
},
    OnSessionEnded: function(sessionEndedRequest,session){
     }
};

Still trying to Figure out what thus this OnIntent do in this event Handler;

thus it does (In Session)," Alexa, ask Invocation, then utterance" (just confuse
that you have to Ask Alexa again(launching?) session your Awaking Alexa again)

or is it just the Three routes in the Story Skill (Path one, Path two, Path three)

also I did Delete it and try to see if it Work's and it doesn't

Be Blessed and Much love

KC.D

1 Answers1

1

The "onIntent" function in the Alexa Skills Kit is the middle layer between the Alexa Voice Service and the skill you're building. It takes the "intent" (thing a user requested, based on your Sample Utterances) and passes it along to the matching function within your own code.

You can see a sample of some intentHandlers in Amazon's example "Hello World" code: https://github.com/amzn/alexa-skills-kit-js/blob/6c59448d8bb2701433ab7e117574199012bedd3f/helloWorld/src/index.js#L64-L72

There's also a great walkthrough of the Skills Kit (including the code in your question) here: http://tobuildsomething.com/2015/08/14/Amazon-Alexa-JavaScript-SDK-The-Ultimate-Guide/

To your concern about awaking Alexa multiple times: Amazon provides a great breakdown of what a user request will look like: https://developer.amazon.com/docs/custom-skills/understanding-how-users-invoke-custom-skills.html

I highly recommend the other docs there as well as the intro tutorial. That will help make the way you interact back with your users a little clearer, too.

Alex
  • 1,434
  • 10
  • 17