botman / driver-amazon-alexa

BotMan Amazon Alexa Driver
MIT License
14 stars 11 forks source link

Fix event type #12

Open dottxado opened 3 years ago

dottxado commented 3 years ago

Alexa payloads are different based on the request type: if the type is "IntentRequest" there is also the "name" of the intent, who is configured in the Alexa developer portal by the developer; but if the type is "LaunchRequest" or "SessionEndedRequest" there is no "name" field, resulting in an error. These special types are used from Alexa to send the first opening of the skill (when you open a skill without declaring an intent) or when it needs to be closed gracefully.

With this PR my aim is to add the management of these requests so that it doesn't break anything. Tested with unit tests and with a production application.