Skip to content

Instantly share code, notes, and snippets.

@muttoni
muttoni / index.js
Created September 12, 2019 12:22
ciao-mondo
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest';
},
handle(handlerInput) {
@muttoni
muttoni / index.js
Last active June 20, 2019 20:04
Empty Fridge
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
@muttoni
muttoni / index.js
Last active June 17, 2019 11:10
My Doctor Skill
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const persistenceAdapter = require('ask-sdk-s3-persistence-adapter');
const {
getSlotValue
} = require('ask-sdk-core');
@muttoni
muttoni / index.js
Created March 13, 2019 14:56
Country, Capital or City - Copyright © 2019 Daphne
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const game_data = {
'cambridge' : 'city',
'london' : 'capital',
'england' : 'country',
'milan' : 'city',
@muttoni
muttoni / index.js
Last active March 11, 2019 15:28
NumberGeek
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const fetch = require('node-fetch');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
// INTERCEPTOR -- add this in your request interceptor to auto-populate ISPs in your session attributes.
let sessionAttributes = handlerInput.attributesManager.getSessionAttributes() || {};
if (handlerInput.requestEnvelope.session['new'] || !sessionAttributes.inSkillProducts) {
let inSkillProductArray, persistentAttributes, ispObject;
// first populate ISP info
try {
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const LaunchRequestHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest';
},
@muttoni
muttoni / index.js
Last active December 5, 2018 14:03
Swear Jar Skill
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const ISworeIntentHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'
@muttoni
muttoni / index.js
Created October 23, 2018 09:25
Quote of the Day Sample
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const GetQuoteHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'