【发布时间】:2020-03-30 20:30:48
【问题描述】:
我正在使用城市插槽。所以,现在我想做的是让 alexa 说出城市名称。但它不起作用。
const GetCityNameIntent = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'GetCityNameIntent';
},
handle(handlerInput) {
const cityName = this.event.request.intent.slots.City.value;
const speakOutput = `${cityName} is this` ;
return handlerInput.responseBuilder
.speak(speakOutput)
//.reprompt(speakOutput)
.getResponse();
}
};
【问题讨论】:
标签: node.js alexa alexa-skill alexa-slot