I'm trying to switch Intents, without using ElicitSlot. The reason is because my next Intent does not require slots or user input.
Currently I am using ElicitSlot. In the Greetings intent, I set the slot Nums. In the news intent, I check if the slot 'Nums' exist and proceed accordingly. However this doesn't work, and it still asks for the Prompt for the 'Nums' slot.
Current Greetings Intent: Fulfillment
var sessionAttributes = intentRequest.sessionAttributes;
var slots = intentRequest.currentIntent.slots;
const num = slots.Num;
if(num == 1){
str = 'News';
intentRequest.currentIntent.name = 'News';
intentRequest.currentIntent.slots = {
Nums: 3
}
callback(close(sessionAttributes, str, intentRequest.currentIntent.slots, 'Nums'));
}
Current News Intent: Lambda initialization and validation
if(!slots.Nums){
slots.Nums = intentRequest.inputTranscript;
callback(close(sessionAttributes, 'News', slots, 'Nums'));
}
if(slots.Nums){
callback(close(sessionAttributes, 'News', slots, 'Displaying News...'));
}
Example Successful Dialog:
User: Hi
Bot: Welcome: (1) News (2) Option2 (3) Option 3
User: 1
Bot: Displaying News...