Skip to content

Instantly share code, notes, and snippets.

@memodoring
Created August 21, 2018 22:07
Show Gist options
  • Save memodoring/84f19600e1c55f68e24af16535af52b8 to your computer and use it in GitHub Desktop.
Save memodoring/84f19600e1c55f68e24af16535af52b8 to your computer and use it in GitHub Desktop.
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()));
}
};
@rakolock1
Copy link

i am getting the same error that darianbjohnson got. Unfortunately, I'm not sure what I need to update or how to do it. A little help would be appreciated. Thanks!

@memodoring
Copy link
Author

i am getting the same error that darianbjohnson got. Unfortunately, I'm not sure what I need to update or how to do it. A little help would be appreciated. Thanks!

Hey rakolock1, you need to make sure you have the latest ask-sdk in your node_modules folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment