Skip to content

Instantly share code, notes, and snippets.

@bpcrao
bpcrao / index.js
Created October 16, 2019 14:14
Alexa GreetPersonIntent
const GreetPersonIntentHandler = {
 canHandle(handlerInput) {
 return handlerInput.requestEnvelope.request.type === 'IntentRequest'
 && handlerInput.requestEnvelope.request.intent.name === 'GreetPersonIntent';
 },
 handle(handlerInput) {
//getting the slot value
let name = handlerInput.requestEnvelope.request.intent.slots.person.value; 
 const speechText = `Hello ${name}, good to meet you.`;
 return handlerInput.responseBuilder
@bpcrao
bpcrao / index.js
Created October 16, 2019 14:11
Launch Request Handler
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === ‘LaunchRequest’;
},
handle(handlerInput) {
const speechText = ‘Welcome to your Greeter’;
return handlerInput.responseBuilder
.speak(speechText)
.getResponse();
},