We will be editing the code inline, in the index.js file on the developer portal itself:
- Implement the handling of events in exports.handler. Our Lambda will be handling two basic requests:
-
- LaunchRequest: To handle the launch of the skill
- IntentRequest: To handle various intents (in our case we have just two intents, the first one being the fetchPrice intent, which asks the Lambda to fetch the price of a specific cryptocurrency, and AMAZON.StopIntent, which indicates an exit from the skill)
We'll start by segregating each of the requests that our skill receives. For this, declare the following handler:
exports.handler = function (event, context) { try { if (event.request.type === "LaunchRequest") {