Search code examples
alexa-skills-kit

you just triggered <custom intent name>


Messing around with creating an alexa skill and I keep getting a message like I seem to successfully invoke the intent.

When I say "I want accents" alexa responds "You just triggered BuyAccentsIntent" or whatever I name the intent in the interaction model.

my code looks like this. As far as i can tell nothing is ever logged. I'm certain this is some stupid incorrect assumption I have made about how to link intent handlers with intent names, but I'm not sure what it is. I made the same mistake on the previous intent and fixed it but I'm not sure how. They both look like they follow the same pattern to me.

const BuyAccentsIntentDoesThisEvenMatterHandler = {
  canHandle(handlerInput) {
      console.log('handlerInput:'+handlerInput);
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
            && handlerInput.requestEnvelope.request.intent.name === 'BuyAccentsIntentTwo';
    },
  handle(handlerInput) {
    console.log('BuyAccentsIntentHandler');

    return handlerInput.responseBuilder
            .speak("buy something then")
            //.reprompt('add a reprompt if you want to keep the session open for the user to respond')
            .getResponse();



    }
};

Solution

  • I hadn't included my handler in the custom request handlers.

    Alexa.SkillBuilders.custom().addRequestHandlers()