Created
February 22, 2020 10:48
-
-
Save kinisoftware/d2e9c372892496d33af1a8b17c79a1fa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class LogRequestInterceptor : RequestInterceptor { | |
| override fun process(input: HandlerInput) { | |
| input.attributesManager.requestAttributes[SOME_REQUEST_ATTRIBUTE] = "someAttributeValue" | |
| println("Request: ${JacksonSerializer().serialize(input.request)}") | |
| } | |
| } | |
| class AnyIntentHandler : RequestHandler { | |
| override fun canHandle(input: HandlerInput) = | |
| input.matches(Predicates.intentName("AnyIntent")) | |
| override fun handle(input: HandlerInput): Optional<Response> { | |
| val someRequestAttribute = input.attributesManager.requestAttributes[SOME_REQUEST_ATTRIBUTE] | |
| return input.responseBuilder.withSpeech("¡Hola!").build() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment