alexa-js / alexa-app

A framework for Alexa (Amazon Echo) apps using Node.js
https://www.youtube.com/watch?v=pzM4jv7k7Rg
MIT License
1.03k stars 213 forks source link

Setting context #345

Open alekslyse opened 6 years ago

alekslyse commented 6 years ago

Is it possible to set a context state or trigger a dialogue if none is set in the pre function?

Example if I want to just get data from one category I would like Alexa to ask what category do you want once, remember it unless the user say change category.

Something like the pre function if all underlying intents require category set.

matt-kruse commented 6 years ago

You can use session attributes for this. Each intent could call a common function to check to see if category is set in session, and if not, prompt the user for it. Or you could also do it in pre().

alekslyse commented 6 years ago

So is it possible to start an alexa conversation with a custom function?

call function by code -> alexa starts conversation dialouge -> go on with code

If so, is it described in the doc?