我正在研究一个Alexa Skill,它会问你一个问题,然后等待你的回复 .

我让她通过设置应该结束会话为假来做到这一点 .

//I'm using node.js 6.10 btw
this.handler.response.response.shouldEndSession = false;

我有一个为回应而设立的意图 . 一个话语只是一个插槽,我还有更多的前缀,如“我的答案是......” . 直到这一点它运行良好,但现在我已经决定添加DynamoDB集成,以便我可以在问题之间有更长的休息时间 . 我有意请求下一个问题,该问题也会从会话属性中初始化变量 .

我的问题是,如果会话结束并且用户使用此意图重新打开它,alexa似乎不接受任何意图而不告诉她的名字和技能名称,即使她打开麦克风(LED指示灯亮)...

例如,我可以告诉我这样的答案“Alexa,告诉MySkill anwer是[答案]”而不是仅仅说“[答案]” .

她处理我说的话就好像我在技能之外发出命令一样 . 我不知道这是否足够清楚但是例如如果答案是“停止”而不是说那是正确/不正确的话她会说'theres is not music playing'或类似的东西或者是否是她不能处理像'一只猫'而不是(再次)说正确/不正确或至少执行我的技能后备意图她说她的默认'我不知道'文本 .

任何的想法?

EDIT:

这是我的代码,用于响应下一个问题意图 .

//add event handler. we only read the question when users press 2 echo buttons. This is to ensure the buttons are awake and connected.
    //obj is 'this' in the event handler, this code is moved to a function
    var dir = wakeupDirective;
    //.. add gadget ids to directive..
    obj.response._addDirective(dir);
    obj.response.speak("Press your echo buttons when you are ready for the next one.");
    obj.emit(":responseReady");

按下2个按钮时处理事件的其他功能

var handleInput = function(){
      //.. other events
      this.attributes.status = -1;
      qind = this.attributes.qind;
      questionQueue = this.attributes.questions;
      tellNextQuestion(this,"");
    }

function tellNextQuestion(obj,text,emit = true){
    text += "The next question is..." + questionQueue[qind].question + "<audio src='https://s3.amazonaws.com/ask-soundlibrary/foley/amzn_sfx_rhythmic_ticking_30s_01.mp3'/>";
    //add input handler for 'buzz in'
    obj.response._addDirective(buttonPressDirective);
    delete obj.handler.response.response.shouldEndSession;
    obj.response.speak(text);
    if(emit)
        obj.emit(':responseReady');
}

这里是有人buzzez时运行的代码(无论是否有“中断”,这都是相同的 .

var g = events[i].inputEvents[0].gadgetId;
waitingAnswer = true;
teamBuzzedIn = t1color;

if(this.attributes.teams[t2color].gid == g){
    teamBuzzedIn = t2color;
}

this.response.speak("Go ahead "+ teamBuzzedIn + " team. I am waiting for your answer.");
this.response.listen("You have 8 more seconds to answer.");
this.handler.response.response.shouldEndSession = false;
this.emit(':responseReady');