lundi 18 décembre 2017

Alexa lambda function is able to execute all intents except custom one?

The launch (New Session), unhandled, and Amazon default intents (cancel, help, stop) are working properly when I test them in the service simulator, but any one that I write doesn't seem to work. Below is an example of a test intent:

var handlers = {
'NewSession': function() {
    this.emit(':tell', 'Hello');

'Test': function() {
    this.emit(':tell','This intent is working');    
},     
'Unhandled': function() {
    this.emit(':tell','Sorry, I don\'t know what to do');    
},   
'AMAZON.HelpIntent': function(){
    this.emit(':ask', 'What can I help you with?', 'How can I help?');
},
'AMAZON.CancelIntent': function(){
    this.emit(':tell', 'Okay');
},
'AMAZON.StopIntent': function(){
      this.emit(':tell', 'Goodbye');
},


exports.handler = function(event,context){
var alexa = Alexa.handler(event,context);
alexa.registerHandlers(handlers);
alexa.execute();
};

The code snippet for the intents:

 "intents": [
  {
    "name": "AMAZON.CancelIntent",
    "samples": []
  },
  {
    "name": "AMAZON.HelpIntent",
    "samples": []
  },
  {
    "name": "AMAZON.StopIntent",
    "samples": []
  },
  {
    "name": "ColorIntent",
    "samples": [],
    "slots": [
  {
    "name": "Test",
    "samples": [
      "Test me"
    ],
    "slots": []

No matter what I do, I can't get the test intent to work and return "This intent is working'. Please help!

Aucun commentaire:

Enregistrer un commentaire