您可以在此处阅读,您可以通过特定请求调用技能。
但是我的技能有一个新会话的处理程序,一旦我尝试使用特定请求调用我的技能,它仍然会在这个新的会话函数中结束。
const handlers = {
'NewSession': function () {
this.attributes.speechOutput = this.t('WELCOME_MESSAGE', this.t('SKILL_NAME'));
this.attributes.repromptSpeech = this.t('WELCOME_REPROMT');
this.emit(':ask', this.attributes.speechOutput, this.attributes.repromptSpeech);
},
'RankIntent': function () {
const rank1raw = this.event.request.intent.slots.RankOne;
const rank2raw = this.event.request.intent.slots.RankTwo;
...
}
}
有没有办法获得正确的意图,或者我是否必须在 newSession 函数中执行一些 if 子句来查看即将到来的内容以及哪个函数应该响应?