Created
August 21, 2018 22:07
-
-
Save memodoring/84f19600e1c55f68e24af16535af52b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const upsInterceptor={ | |
async process(handlerInput){ | |
let { requestEnvelope, serviceClientFactory, attributesManager} = handlerInput; | |
let {deviceId} = requestEnvelope.context.System.device; | |
const upsServiceClient = serviceClientFactory.getUpsServiceClient(); | |
const usertimeZone = await upsServiceClient.getSystemTimeZone(deviceId); | |
const requestAttributes = attributesManager.getRequestAttributes(); | |
requestAttributes.timeZone = usertimeZone; | |
attributesManager.setRequestAttributes(requestAttributes); | |
console.log(JSON.stringify(attributesManager.getRequestAttributes())); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey rakolock1, you need to make sure you have the latest ask-sdk in your node_modules folder