0
votes

I'm creating an alexa skill which have several different states. I want to define an intent that will work over the whole app, regardless of state.

So far I've tried:

Alexa.CreateStateHandler([array, of, states], {
  globalIntent() {
    this.emit(':tell', 'something for alexa to say');
  },
});

My only work around for this is to define the globalIntent in every state which is fine but I'm wondering if there's a more elegant solution.

Thanks!

1

1 Answers

0
votes

You can redirect to another intent and retain the current state with something like:

this.emitWithState('globalIntent');

Any session attributes that have been set or modified, such as speechOutput, will be available to the globalIntent.