I have a question, it is possible that it can be called again method that was executed in a handlerIntent? When you come back and finish talking? I need to rerun: const response = await logic.consultaService (1,1,1100);
after finishing the call
Without the user having to say the command again
I require an automatic action until the user says stop
return handlerInput.responseBuilder .speak (speechText) .reprompt ('tss') .getResponse ();
thank you.
Code:
const CustomServiceIntent = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'CustomServiceIntent';
},
async handle(handlerInput) {
try {
await logic.callDirectiveService(handlerInput,"espera");
} catch (error) {
console.log("Progressive error : " + error);
}
const response = await logic.consultaServicio(1,1,1100);
let speechText="";
if(response) {
const results = response;
results.forEach(function (elemento, indice, array) {
speechText += " El " + " " + " siguiente " +" "+ " niño " + " "+ " en "+" " + " salir es " + " " +" . " + elemento.nombre + " . " ;
});
}
return handlerInput.responseBuilder
.speak(speechText)
.reprompt('tss')
.getResponse();
}
};