This commit is contained in:
ろむねこ 2024-07-16 15:29:11 +09:00
parent 63a6054262
commit 6cd3df6ed2
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168
2 changed files with 17 additions and 2 deletions

View File

@ -5,7 +5,6 @@
"main": "index.js",
"scripts": {
"build": "tsc",
"pjson": "ts-node ./src/tools/gen-package-json.ts > ./lambda/package.json",
"clean": "rm -rf ./lambda/*"
},
"author": "Amazon Alexa",

View File

@ -43,6 +43,21 @@ const KidShiftAuthIntentHandler = {
}
};
const KidShiftAuthIntentResutHandler = {
canHandle(handlerInput: Alexa.HandlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent'
&& Alexa.getDialogState(handlerInput.requestEnvelope) === 'COMPLETED';
},
async handle(handlerInput: Alexa.HandlerInput) {
const speakOutput = 'Hello World!2';
return handlerInput.responseBuilder
.speak(speakOutput)
.getResponse();
}
};
const HelpIntentHandler = {
canHandle(handlerInput: Alexa.HandlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
@ -136,7 +151,8 @@ exports.handler = Alexa.SkillBuilders.custom()
FallbackIntentHandler,
SessionEndedRequestHandler,
IntentReflectorHandler,
KidShiftAuthIntentHandler)
KidShiftAuthIntentHandler,
KidShiftAuthIntentResutHandler)
.addErrorHandlers(
ErrorHandler)
.withPersistenceAdapter(new DynamoDBPersistantAttributesAdapter.DynamoDbPersistenceAdapter({