This commit is contained in:
rca 2024-07-17 06:42:53 +09:00
parent a03f1a7e7c
commit 899b73c2f4

View File

@ -33,22 +33,7 @@ const HelloWorldIntentHandler = {
const KidShiftAuthIntentHandler = {
canHandle(handlerInput: Alexa.HandlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftLoginIntent';
},
async handle(handlerInput: Alexa.HandlerInput) {
const speakOutput = 'Hello World!2';
return handlerInput.responseBuilder
.speak(speakOutput)
.getResponse();
}
};
const KidShiftAuthIntentResutHandler = {
canHandle(handlerInput: Alexa.HandlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent'
&& Alexa.getDialogState(handlerInput.requestEnvelope) === 'COMPLETED';
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent';
},
async handle(handlerInput: Alexa.HandlerInput) {
const speakOutput = 'Hello World!2';
@ -146,13 +131,12 @@ exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
HelloWorldIntentHandler,
KidShiftAuthIntentHandler,
HelpIntentHandler,
CancelAndStopIntentHandler,
FallbackIntentHandler,
SessionEndedRequestHandler,
IntentReflectorHandler,
KidShiftAuthIntentHandler,
KidShiftAuthIntentResutHandler)
IntentReflectorHandler)
.addErrorHandlers(
ErrorHandler)
.withPersistenceAdapter(new DynamoDBPersistantAttributesAdapter.DynamoDbPersistenceAdapter({