Я пишу навыки Alexa для получения списка информации от пользователя, подтверждения первого слота с пользовательскими значениями, а затем делегирования обратно в Alexa, проблема в том, что Alexa продолжает запрашивать вопрос подтверждения и не делегирует Alexa. Ниже мой код:
if (request.intent.dialogState !== "COMPLETED") {
if (receiverName) {
const response = `Do you mean ${collectedData.join(' and ')} ?`;
return handlerInput.responseBuilder
.addConfirmSlotDirective('ReceiverName')
.speak(response)
.getResponse();
}
return handlerInput.responseBuilder
.addDelegateDirective()
.getResponse();
} else {
const messageData = {
//Message Data
}
const res = await utils.httpPost("/send-mail",messageData, accessToken);
speechText = "Your email has been sent successfully to " + receiverName + "! Thank you!";
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.getResponse();
}
}