Skip to content

Commit

Permalink
Updated intenthandlers with responseBuilder API
Browse files Browse the repository at this point in the history
  • Loading branch information
Srivastava committed Aug 22, 2017
1 parent 1b1b03d commit a0d17e0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,24 @@ var handlers = {
var factIndex = Math.floor(Math.random() * factArr.length);
var randomFact = factArr[factIndex];
var speechOutput = GET_FACT_MESSAGE + randomFact;
this.emit(':tellWithCard', speechOutput, SKILL_NAME, randomFact)

this.response.cardRenderer(SKILL_NAME, randomFact);
this.response.speak(speechOutput);
this.emit(':responseReady');
},
'AMAZON.HelpIntent': function () {
var speechOutput = HELP_MESSAGE;
var reprompt = HELP_REPROMPT;
this.emit(':ask', speechOutput, reprompt);

this.response.speak(speechOutput).listen(reprompt);
this.emit(':responseReady');
},
'AMAZON.CancelIntent': function () {
this.emit(':tell', STOP_MESSAGE);
this.response.speak(STOP_MESSAGE);
this.emit(':responseReady');
},
'AMAZON.StopIntent': function () {
this.emit(':tell', STOP_MESSAGE);
this.response.speak(STOP_MESSAGE);
this.emit(':responseReady');
}
};

0 comments on commit a0d17e0

Please sign in to comment.