Skip to content

Instantly share code, notes, and snippets.

@kinisoftware
Created October 22, 2020 17:09
Show Gist options
  • Select an option

  • Save kinisoftware/2778535ea53975ee973cd91b3a85f310 to your computer and use it in GitHub Desktop.

Select an option

Save kinisoftware/2778535ea53975ee973cd91b3a85f310 to your computer and use it in GitHub Desktop.
NextPageIntentHandler
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