0

複数のカスタム スキル インテントがあります。すべてのカスタム インテントのキャンセル イベントを処理したい。どのキャンセルが呼び出されているかを取得するにはどうすればよいですか。

const Alexa = require('alexa-sdk');
exports.handler = (event, context) => {
  const alexa = Alexa.handler(event, context);
  var APP_ID = "amzn1.ask.skill.[ssdad-5c61-4d4e-b2bf-7eea8a491816]";
  alexa.APP_ID = APP_ID;
  alexa.registerHandlers(handlers);
  alexa.execute();
};
const handlers = {
  'ConfirmChangeEvent': function() {
    this.emit(':ask', "Do u want commit for change? ");
  },
  'ConfirmLastAction': function() {
    this.emit(':ask', "Do u want confirm for last Action?");
  },

  'LaunchRequest': function() {
    this.emit(':tell', "Hi Damodar, I'm Dialogue manager");
  },
  'Amazon.CancelIntent' : function() {
    // i want handle cancel on both intents here  ConfirmLastAction and Conf irmChangeEvent

    //if ConfirmChangeEvent  should give output like "Okay cancelling changeEvent "

    // ConfirmChangeEvent  should give output like "Okay cancelling the Last Action " 

  }

  'Unhandled': function() {
    this.emit(':tell', "I'm not able to respond at this time");
  }
};

ノードJS Alexaでこれをどのように処理できますか

4

1 に答える 1