Skip to content

Instantly share code, notes, and snippets.

@kinisoftware
Created February 3, 2020 18:42
Show Gist options
  • Select an option

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

Select an option

Save kinisoftware/eb3ddeeecf1cbcba9862cb2e0d28e785 to your computer and use it in GitHub Desktop.
session_options_response.kt
if (movies.isEmpty()) {
text = Translations.getMessage(language, Translations.TranslationKey.UPCOMINGS_NOT_FOUND) +
Translations.getMessage(language, Translations.TranslationKey.ASKING_FOR_NOW_PLAYING)
shouldEndSession = false
} else {
text = "${Translations.getMessage(language, Translations.TranslationKey.UPCOMINGS_RESPONSE)}: " +
movies.map { it.getTitle() }.getResponse(language)
shouldEndSession = true
}
return input.responseBuilder
.withSpeech(text)
.withShouldEndSession(shouldEndSession)
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment