我正在为 Alexa 创建自定义技能。我想关闭会话AMAZON.StopIntent
。我怎样才能用下面的代码实现这一点?
const ExitHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& (request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak('bye!')
.reprompt('bye!')
.getResponse();
},
};