question

Dennis avatar image
Dennis asked

How can I make sure, that after the 'LaunchRequest' the User trigger an existing intent

Hello Community,

at the moment I have following important code:

const handlers = {
    'LaunchRequest': function () {
        this.emit(':ask',this.t("START_MESSAGE"));
    },
    'StartGame': function() {
        G.start(this);
    },
    'AMAZON.HelpIntent': function () {
        F.help(this);
    },

After the LaunchRequest the User get asked if he wants to start the game or if he needs some help. He should say 'Start' or 'Help'. But if he say some random words the skill break down.

Because I start with a LaunchRequest, I can´t add slots and make sure that it get filled with the right content. I searched something, called 'Unhandled' Intent, but I didn´t get it :( .

Have someone an Idea and can help me, please?

Cheers

Dennis

alexa skills kithelpintentslaunch
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.

I found out, there is something new called "Amazon.FallbackIntent".

https://developer.amazon.com/blogs/alexa/post/c97f3bb7-9701-41e8-ac06-a3a44b9f1638/use-the-new-fallback-intent-to-respond-gracefully-to-unexpected-customer-requests

Sounds exactly like a solution for my problem, but...it´s just for English speaking skills and my skill is actually in German :(

So still same problem...

0 Likes 0 ·

1 Answer

Anand@Amazon avatar image
Anand@Amazon answered

Hello Developer,

Yes, Fallback is only available for english speaking locales but you can create catchAll intent which will trigger once it not matches with any of the utterance phrases.

But if you building in SDK v2 then it's very easy to build in. You can create a error handler which will trigger if their canHandle() function get satisfied.

const ErrorHandler = {
  canHandle() {
    return true;
  },
  handle(handlerInput, error) {
    console.log(`Error handled: ${error.message}`);

    return handlerInput.responseBuilder
      .speak('Sorry, an error occurred.')
      .reprompt('Sorry, an error occurred.')
      .getResponse();
  },
};
10 |5000

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