I'm trying to mix dialog management and intent chaining. I have disabled auto delegation.
But I'm stuck at, When the user fills all the slot values and then I use intent confirmation and prompt him if the data is correct.
If the user says "No". I want to restart the dialog management for the same intent.
But the error I'm getting is, "Directive "Dialog.Delegate" can be used only when a dialog is active and hasn't been completed".
I tried replacing line 15 with some other intent, it works, but not when I send the directive for the same intent. Does anyone know what I'm missing?
const DeniedPostMessageIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest' &&
handlerInput.requestEnvelope.request.intent.name === 'PostMessageIntent' &&
handlerInput.requestEnvelope.request.dialogState === 'COMPLETED' &&
handlerInput.requestEnvelope.request.intent.confirmationStatus === 'DENIED';
},
handle(handlerInput) {
let speechText = ri('POST_MESSAGE.DENIED');
return handlerInput.jrb
.speak(speechText)
.addDelegateDirective({
name: 'PostMessageIntent',
confirmationStatus: 'NONE',
slots: {}
})
.getResponse();
},
};