javascript - Different Invocations with one Alexa Skill -


i have skill skillintent when ask ask specific game, replies description of skill. works - i'm trying now, however, reply has skill, if asked differently.

below working code:

'use strict';  var alexaskill = require('./alexaskill'),     descriptions = require('./descriptions');  var app_id = undefined;  var zombicideskills = function () {     alexaskill.call(this, app_id); };  // extend alexaskill zombicideskills.prototype = object.create(alexaskill.prototype); zombicideskills.prototype.constructor = zombicideskills;  zombicideskills.prototype.eventhandlers.onlaunch = function (launchrequest, session, response) {     var speechtext = "you can ask question like, skill do? ... now, can with.";      var reprompttext = "for instructions on can say, please me.";     response.ask(speechtext, reprompttext); };  zombicideskills.prototype.intenthandlers = {     "skillintent": function (intent, session, response) {         var skillslot = intent.slots.skill,             skillname;         if (skillslot && skillslot.value){             skillname = skillslot.value.tolowercase();         }          var cardtitle = "description " + skillname,             description = descriptions[skillname],             speechoutput,             repromptoutput;         if (description) {             speechoutput = {                 speech: description,                 type: alexaskill.speechoutputtype.plain_text             };             response.tellwithcard(speechoutput, cardtitle, description);         } else {             var speech;             if (skillname) {                 speech = "i'm sorry, don't know if know " + skillname + ". else can with?";             } else {                 speech = "i'm sorry, not know skill. else can with?";             }             speechoutput = {                 speech: speech,                 type: alexaskill.speechoutputtype.plain_text             };             repromptoutput = {                 speech: "what else can with?",                 type: alexaskill.speechoutputtype.plain_text             };             response.ask(speechoutput, repromptoutput);         }     },      "amazon.stopintent": function (intent, session, response) {         var speechoutput = "goodbye";         response.tell(speechoutput);     },      "amazon.cancelintent": function (intent, session, response) {         var speechoutput = "goodbye";         response.tell(speechoutput);     },      "amazon.helpintent": function (intent, session, response) {         var speechtext = "you can ask questions such as, skill do, or, can exit... now, can with?";         var reprompttext = "you can things like, skill do, or can exit... now, can with?";         var speechoutput = {             speech: speechtext,             type: alexaskill.speechoutputtype.plain_text         };         var repromptoutput = {             speech: reprompttext,             type: alexaskill.speechoutputtype.plain_text         };         response.ask(speechoutput, repromptoutput);     } };  exports.handler = function (event, context) {     var zombicide = new zombicideskills();     zombicide.execute(event, context); }; 

it's modeled of mc helper. implement additional intenthandlers called 'actorintent' , in utterences specify actorintent {actors} have {skill} skill?

i've been playing around idea, i'm not quite sure how troubleshoot lambda functions yet - it's kind of 'upload , see if endpoint reachable'.

it annoying if had have 2 -different- skills this, i'm unsure? issue code base, , should able go , create actorintent without issue?

define different intent, example, skillownerintent , in interaction model in alexa developer portal, define utterances intent. not need make skill this.


Comments