0

I have created custom skill intent called EmergencyIntent by using the skill builder beta.

Now the problem is it's not asking Intent confirmation as I configured in skill builder.

Created EmergencyIntent, added sample utterance as emergency detected. then intent confirm message added

Added emergencyIntent in index.js

tried like this also

Without giving output message

Test result is empty when I say emergency detected

why it's not asking for intent confirmation?

  • I have fixed this issue using 'EmergencyIntent': function() { //this.response.speak(':confirm'); this.emit(':delegate') }, –  Nov 09 '17 at 06:23

1 Answers1

0

From your comment it looks like you've resolved your issue. But, I thought I'd add that you could also check the dialog state before emitting your final response. Something like...

let dialogState = this.event.request.dialogState;
try {
  if (dialogState == "STARTED" || dialogState == "IN_PROGRESS") {
    this.emit(":delegate");
  }
} catch(err) {
  console.log("Error: " + err.message);
}
Steve Tingiris
  • 331
  • 1
  • 5
  • Thank you. But in my case above code causing some issue. –  Nov 10 '17 at 04:13
  • User: Alexa play songs/musician Alexa: Do you want to play any specific songs? if User says: Yes Alexa: Are you looking for any specific songs? User: YES Alexa: artist your looking for? User: artist name Alexa: movies your looking for? User: movie name Alexa: album your looking for? User: album name // after all questions Alexa: Okay playing songs form artist/album/movie name if User says: No Alexa: Okay playing songs //Alexa should stop asking questions and it will play some songs –  Nov 10 '17 at 04:13
  • When i'm saying NO it should stop ask other questions –  Nov 10 '17 at 04:17
  • Where should I get slot value? ' let dialogState = this.event.request.dialogState; try { if (dialogState == "STARTED" || dialogState == "IN_PROGRESS") { this.emit(":delegate"); } } catch(err) { console.log("Error: " + err.message); }' –  Nov 10 '17 at 04:40
  • I'm not sure I'm exactly following the dialog logic but to deal with yes/no questions you have two options - use the dialog interface (see: https://developer.amazon.com/docs/custom-skills/dialog-interface-reference.html) and/or the AMAZON.YesIntent and AMAZON.NoIntent in which case you'd probably want to use state handlers so you could use the responses to yes/no for different questions. (see: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs#making-skill-state-management-simpler). – Steve Tingiris Nov 10 '17 at 13:22
  • I read the dialog example you provided again and I'm still not following the conversation flow. Wouldn't a user just say something like: 'Alexa, ask {invocation-name} to play {songName} by {artistName}? Or, 'Alexa, ask {invocation-name} to play songs by {artistName}. Where the response to elicit the {songName} might be: 'Okay, which song by {artistName} would you like me to play?' – Steve Tingiris Nov 10 '17 at 13:28