-1

I had asked this question before also but no luck, so I am posting again. I am working on amazon alexa skill and I want that when I call 'YESNOIntent' it should answer differently under different Intents.

'FirstIntent': function () {
speechoutput = 'bla bla, would you like to know anything else?'
this.emit(":ask", speechOutput)
},

'YESNOIntent': function (){
speechoutput = 'speech1'
this.emit(":ask", speechOutput)
},

'SecondIntent': function () {
speechoutput = 'bla bla, would you like to know anything else?'
this.emit(":ask", speechOutput)
},

'YESNOIntent': function (){
speechoutput = 'speech2'
this.emit(":ask", speechOutput)
},

'ThirdIntent': function () {
speechoutput = 'bla bla, would you like to know anything else?'
this.emit(":ask", speechOutput)
},

'YESNOIntent': function (){
speechoutput = 'speech3'
this.emit(":ask", speechOutput)
},

...... so on

johndoe
  • 4,387
  • 2
  • 25
  • 40
developer
  • 81
  • 8
  • Possible duplicate of [Amazon Alexa Skill](https://stackoverflow.com/questions/52077201/amazon-alexa-skill) – jonrsharpe Sep 13 '18 at 14:13
  • @jonrsharpe thank you for your response, actually the previous question was also posted by me but the suggestion on the didn't work out for me. – developer Sep 13 '18 at 14:17
  • 1
    So you [edit] your first question with what you've learned. I see no progression here, so it shouldn't be a new question. – jonrsharpe Sep 13 '18 at 14:24
  • yes it's the same as previous questoin, but as you see I didn't get the desired result so I thought to post the question in more detailed way and easily understandable format. – developer Sep 13 '18 at 16:57

1 Answers1

2

YES and NO are two different things. You cannot merge these two into a single YesNoIntent. As I said in my previous answer you should use AMAZON.YesIntent and AMAZON.NoIntent.

Make use of sessionAttributes to keep track of "where you are with respect to the conversation" so that you can give a correct response when AMAZON.YesIntent or AMAZON.NoIntent handlers are triggered.

johndoe
  • 4,387
  • 2
  • 25
  • 40
  • Thanks, I am using AMAZON.YesIntent and AMAZON.NoIntent separately, sorry I mentioned it together here by mistake. Will it be possible for you to explain it through my code? – developer Sep 14 '18 at 12:07