Skip to content

Instantly share code, notes, and snippets.

@kinisoftware
Created April 11, 2021 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinisoftware/e881dd3509366845b2189c39d67c79e1 to your computer and use it in GitHub Desktop.
Save kinisoftware/e881dd3509366845b2189c39d67c79e1 to your computer and use it in GitHub Desktop.
class CancelAndStopIntentHandler : RequestHandler {
override fun canHandle(input: HandlerInput) =
input.matches(
intentName("AMAZON.StopIntent")
.or(intentName("AMAZON.CancelIntent"))
.or(intentName("AMAZON.PauseIntent"))
)
override fun handle(input: HandlerInput) = input.responseBuilder
.addAudioPlayerStopDirective()
.withShouldEndSession(true)
.build()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment