에서 특정 요청이있는 스킬을 호출 할 수 없음 알렉사 스킬 코드 :여기 echosim.io
'use strict';
const Alexa = require("alexa-sdk");
exports.handler = function(event, context, callback) {
console.log("skill-sample-nodejs-hello-world Received an event");
console.log("event=");
console.dir(event);
const alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
const handlers = {
'LaunchRequest': function() {
console.log("LaunchRequest called()");
this.response.speak('Hello World Init!').listen("I am listening SayHelloInit");
this.emit(':responseReady');
//this.emit('SayHelloInit');
},
'HelloWorldIntent': function() {
console.log("hello world intent called");
this.response.speak('Hello World How are you!').listen("I am listening sayhello");
this.emit(':responseReady');
//this.emit('SayHello');
},
'AMAZON.HelpIntent': function() {
const speechOutput = 'This is the Hello World Sample Skill. ';
const reprompt = 'Say hello, to hear me speak.';
this.response.speak(speechOutput).listen(reprompt);
this.emit(':responseReady');
},
'AMAZON.CancelIntent': function() {
this.response.speak('Goodbye!');
this.emit(':responseReady');
},
'AMAZON.StopIntent': function() {
this.response.speak('See you later!');
this.emit(':responseReady');
},
'SessionEndedRequest': function() {
console.log("SESSIONENDEDREQUEST");
this.response.speak("SessionEndedRequest. Goodbye!");
this.emit(':responseReady');
},
'Unhandled': function() {
console.log("UNHANDLED");
const message = 'Unhandled';
this.response.speak(message).listen(message);
this.emit(':responseReady');
}
};
다음
몇 가지 이상한 행동을 관찰 : 아마존 개발자 콘솔에서 알렉사 시뮬레이터에서
은 , "집으로 돌아가는 안녕하세요 세상"으로 스킬을 호출 할 수 없었습니다. 응답은 "죄송합니다. 나는 모릅니다." 하지만 "hello world 시작"으로 스킬을 호출 한 후에 "hello world를 시작하여 집에 가십시오"라는 응답을 받고 "Hello World How are you!"라는 응답을 얻을 수 있습니다.
Echosim.io에서 "hello world 시작"으로 스킬을 호출 할 수 있지만 "집으로 돌아가려면 hello world 시작"으로 호출 할 수는 없습니다. 그것은 "미안해"라고 대답합니다. 또한, 재 (reprompt) 연설은 전혀 사용되지 않습니다.
cloudwatch 로그에서 때로는 "SessionEndedRequest"가 이유 코드 "USER_INITIATED"와 함께 람다 함수로 전송 된 것을 볼 수 있습니다. 나는 "중지, 취소"등을 말하지 않았다. 어떻게 USER_INITIATED SessionEndedRequest가 트리거 되는가? 이것은 재 녹음 된 연설이 결코 실행되지 않는다는 사실과 어떻게 관련이 있습니까?
"집에 가서는"다음과 같은 매핑됩니다 : 나는 문제가 최근에가는 다시 메시지를 얻는 데 많은 게시물을 본
{
"name": "HelloWorldIntent",
"samples": [
"hello",
"say hello",
"who are you",
"go home",
"hello world"
],
"slots": []
}
어딘가에 echosim.io가 다시 실행되지 않는다는 의견을 보았습니다. –