question

e-e-harm avatar image
e-e-harm asked

Could I force an intent on launch?

I want to make it so that 'open [myskill]' acts exactly the same way as 'ask [myskill] for a new game.' Any simple way to do this?
alexa skills kitvoice-user interface
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Just respond to the onLaunch() event by calling the same code that is called within your onIntent() event for that intent.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

e-e-harm avatar image
e-e-harm answered
Let's say my onLaunch function is in a file called eventHandlers.js and my NewGameIntent function is in a file called intentHandlers.js. The NewGameIntent function is looking for a variable defined at the top level of intentHandlers.js - how can my onLaunch function get access to that variable?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

e-e-harm avatar image
e-e-harm answered
I apologize for asking a general javascript question, I reckon it is preferable on this forum to ask Alexa Skills Kit related questions only.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Yeah, I can't really help you with basic programming questions. Not a core skill of mine. But there are plenty of resource on the internet, or others on the forum who are better at that.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

e-e-harm avatar image
e-e-harm answered
Thanks again, I've managed to solve this issue on my own.
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

would be interested to know how.

0 Likes 0 ·