Created
October 22, 2020 17:09
-
-
Save kinisoftware/2778535ea53975ee973cd91b3a85f310 to your computer and use it in GitHub Desktop.
NextPageIntentHandler
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 NextPageIntentHandler : RequestHandler { | |
| override fun canHandle(input: HandlerInput): Boolean { | |
| return input.supportAPL() && input.matches(Predicates.intentName("NextPageIntent")) | |
| } | |
| override fun handle(input: HandlerInput): Optional<Response> { | |
| val directive = ExecuteCommandsDirective.builder() | |
| .withToken("newReleasesSkillAPLToken") | |
| .addCommandsItem(SetPageCommand.builder() | |
| .withComponentId("moviesPager") | |
| .withPosition(Position.RELATIVE) | |
| .withValue(1) | |
| .build() | |
| ) | |
| .build() | |
| return input.responseBuilder.addDirective(directive).build() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment