right now i am trying to build a kind of cross-platform with AWS Lambda. My object handler in Lambda should be able to handle requests from an Alexa Skill and from a Google Action. That why i need a depending handler. The Alexa object handler looks like this:
const skillBuilder = Alexa.SkillBuilders.custom();
exports.handler = skillBuilder
.addRequestHandlers(
LaunchRequestHandler,
HelloWorldIntentHandler
)
.addErrorHandlers(ErrorHandler)
.lambda();
And the Assistant object handler looks like this:
exports.handler = function(event, context, callback) {
app.handler(event, {}).then((res) => {
if (res.status != 200) {
callback(null, {"fulfillmentText": `I got status code:
${res.status}`});
} else {
callback(null, res.body);
}
}).catch((e) => {
callback(null, {"fulfillmentText": `There was an error\n${e}`});
});
};
Now i would like to check if the Lambda request comes from Assistant or Alexa and depending on that it should be handled correctly. But so far i am not sure how to do that. do you have any ideas? Thank you in advance!