Skip to content

Instantly share code, notes, and snippets.

@kinisoftware
Created April 26, 2020 09:09
Show Gist options
  • Select an option

  • Save kinisoftware/abb9ddb7668113281a3d6c0b9dca9951 to your computer and use it in GitHub Desktop.

Select an option

Save kinisoftware/abb9ddb7668113281a3d6c0b9dca9951 to your computer and use it in GitHub Desktop.
exports.handler = alexa.SkillBuilders.custom()
.addRequestHandlers(
launchRequestHandler,
addTvShowIntentHandler,
tvShowRecommendationIntentHandler,
helpIntentHandler,
cancelAndStopIntentHandler,
fallbackIntentHandler,
sessionEndedRequestHandler,
intentReflectorHandler
)
.addErrorHandlers(errorHandler)
.addRequestInterceptors(
localisationRequestInterceptor,
loggingRequestInterceptor,
loadAttributesRequestInterceptor
)
.withPersistenceAdapter(
new DynamoDbPersistenceAdapter({
tableName: 'my_tv_shows_skill',
createTable: true,
partitionKeyGenerator: requestEnvelope => {
const userId = alexa.getUserId(requestEnvelope);
return userId.substr(userId.lastIndexOf('.') + 1);
},
})
)
.addResponseInterceptors(saveAttributesResponseInterceptor, loggingResponseInterceptor)
.lambda();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment