0

I'm using STDLIB and Node.js to write an Alexa skill that delivers a random limerick. I want a flow like this:

User: Ask LimerickKid for a limerick.

Alexa skill fires, delivers limerick.

Alexa: Would you like another?

And then use the AMAZON.YesIntent and AMAZON.NoIntent to handle the request and refire the intent if Yes.

My problem is totally Noob. In my LimerickKid.js script, I can execute javascript fine to deliver the limerick. But when I execute this:

    module.exports = function (slots, callback) {

  return callback(null, TheLimerick);

}

Alexa delivers the limerick, and the session terminates. I can't execute any code after that. How do I fire that function and trigger Alexa to ask the user if they want another?

brianfit
  • 1,829
  • 1
  • 19
  • 34
  • Are you commited to Javascript? If you may consider Python, check my ask.py microframework, ideas here: https://www.hackster.io/josep-valls/alexa-message-board-now-with-slack-324b84 – Josep Valls Apr 10 '17 at 19:41
  • That's really handy. Thanks. As a sloppy coder, I do prefer Javascript's compile-time error checking to python's "we'll let you know if there's an error when you run that subroutine" approach. But this looks like a really useful time saver. – brianfit Apr 27 '17 at 11:23
  • You are welcome. Sounds like you are using a linter for Javascript (since there is no compile-time error in Javascript). If that's your only problem with Python, may I suggest you give a try to PyCharm or Aptana/PyDev? – Josep Valls Apr 27 '17 at 15:22

0 Answers0