From 3beb98109f2e90ddce81ff07d7c4f2b821e01290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Tue, 16 Jul 2024 13:47:10 +0900 Subject: [PATCH] test --- src/index.ts | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/src/index.ts b/src/index.ts index 947990c..4e5261a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,27 +20,10 @@ const LaunchRequestHandler = { const HelloWorldIntentHandler = { canHandle(handlerInput: Alexa.HandlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' - && Alexa.getIntentName(handlerInput.requestEnvelope) === 'HelloWorldIntent' - && Alexa.getDialogState(handlerInput.requestEnvelope) === 'COMPLETED'; + && Alexa.getIntentName(handlerInput.requestEnvelope) === 'HelloWorldIntent'; }, async handle(handlerInput: Alexa.HandlerInput) { - const attributesManager = handlerInput.attributesManager; - const attributes = await attributesManager.getPersistentAttributes(); - if (!attributes.counter) { - attributes.counter = 0; - } else { - attributes.counter += 1; - } - - attributesManager.setPersistentAttributes(attributes); - await attributesManager.savePersistentAttributes(); - - const speakOutput = "HelloWorld! You've invoked me " + attributes.counter + " times and dialog value is " + Alexa.getSlotValue(handlerInput.requestEnvelope, 'exampleSlot'); - - return handlerInput.responseBuilder - .speak(speakOutput) - .getResponse(); } }; @@ -50,16 +33,9 @@ const KidShiftAuthIntentHandler = { && Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent'; }, handle(handlerInput: Alexa.HandlerInput) { - const dialogState: DialogState = Alexa.getDialogState(handlerInput.requestEnvelope); - if (dialogState !== 'COMPLETED') { - return handlerInput.responseBuilder - .speak('Not provided') - .getResponse(); - } else { - return handlerInput.responseBuilder - .speak('Provided') - .getResponse(); - } + return handlerInput.responseBuilder + .speak('引数なし呼び出し') + .getResponse(); } };