diff --git a/src/index.ts b/src/index.ts index 50e042a..440c4a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,27 +23,17 @@ const HelloWorldIntentHandler = { }, async handle(handlerInput: Alexa.HandlerInput) { - // const attributesManager = handlerInput.attributesManager; - // const attributes = await attributesManager.getPersistentAttributes(); - // if (!attributes.counter) { - // attributes.counter = 0; - // } else { - // attributes.counter += 1; - // } - - const attributesManager = handlerInput.attributesManager; - let attributes = { "counter": 10 }; + const attributes = await attributesManager.getPersistentAttributes(); + if (!attributes.counter) { + attributes.counter = 0; + } else { + attributes.counter += 1; + } attributesManager.setPersistentAttributes(attributes); await attributesManager.savePersistentAttributes(); - // attributesManager.setPersistentAttributes(attributes); - // - // await attributesManager.savePersistentAttributes(); - // - // const speakOutput = `Hello World! You've visited this skill ${attributes.counter} times.`; - const speakOutput = "HelloWorldぷれーすほーるだー"; return handlerInput.responseBuilder