서비스 시뮬레이터에서 테스트했을 때 시작 (새 세션), 처리되지 않은 항목 및 Amazon 기본 의도 (취소, 도움말, 중지)가 올바르게 작동하지만 작성한 항목 중 아무 것도 작동하지 않는 것 같습니다. 아래는 테스트 목적의 예는 다음과 같습니다알렉사 람다 함수는 사용자 정의 1을 제외한 모든 인 텐트를 실행할 수 있습니까?
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();
};
의도에 대한 코드 : 아무리 내가 뭘
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "ColorIntent",
"samples": [],
"slots": [
{
"name": "Test",
"samples": [
"Test me"
],
"slots": []
, 나는 시험 의도가 작동하고 "이를 돌려받을 수 없습니다 의도는 '도와주세요.!
코드 및 의도가 완전하지 않습니다. 복사하는 동안 놓친 것이 있습니까? 예를 들면 :'NewSession' 함수는'}'에 의해 닫히지 않습니다.'ColorIntent' 인 텐트도 닫히지 않습니다. 코드와 의도가 잘 형성되어 있습니까? –
그래, 나는 우연히 복사하여 붙여 넣었지만 모든 대괄호는 일치해야한다. 코드 및 의도가 오류없이 잘 작성되고 있습니다. – kd1996
코드에 로깅을 추가하고 호출 된 의도를 확인하십시오. 오류 로그 없이는 도움이되지 않습니다. –