Last active
March 11, 2018 15:24
-
-
Save dmurawsky/e45ce462f6d0b3a5fd1aab2a6260f675 to your computer and use it in GitHub Desktop.
example lex lambda
This file contains 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
exports.availability = (event, context, cb) => { | |
context.callbackWaitsForEmptyEventLoop = false; | |
console.log(event, context); | |
return cb(null, { | |
dialogAction: { | |
type: "Close", | |
fulfillmentState: "Fulfilled", | |
message: { | |
contentType: "PlainText", | |
content: "Response from availability lambda" | |
} | |
} | |
}); | |
}; | |
exports.onboarding = (event, context, cb) => { | |
context.callbackWaitsForEmptyEventLoop = false; | |
console.log(event, context); | |
return cb(null, { | |
dialogAction: { | |
type: "Close", | |
fulfillmentState: "Fulfilled", | |
message: { | |
contentType: "PlainText", | |
content: "Response from onboarding lambda" | |
} | |
} | |
}); | |
}; |
This file contains 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
{ | |
"messageVersion": "1.0", | |
"invocationSource": "FulfillmentCodeHook", | |
"userId": "wtu7jir2e3oe1ksgievdfix8jdei4s8x", | |
"sessionAttributes": {}, | |
"requestAttributes": null, | |
"bot": { | |
"name": "MartinBot", | |
"alias": "$LATEST", | |
"version": "$LATEST" | |
}, | |
"outputDialogMode": "Text", | |
"currentIntent": { | |
"name": "MoreNotTheAnswer", | |
"slots": {}, | |
"slotDetails": {}, | |
"confirmationStatus": "None" | |
}, | |
"inputTranscript": "give me more!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment