Learn more about the Jovo $response
object.
Learn more about the Request & Response Lifecycle here.
This is a companion discussion topic for the original entry at https://www.jovo.tech/docs/requests-responses/response
Learn more about the Jovo $response
object.
Learn more about the Request & Response Lifecycle here.
I’d like to be able to manipulate the $response
object or the $output
object to set shouldEndSession
to false when using tell
. Essentially, I want to be able to say something back to the user before I move on to another intent handler. How should I go about this?
You have a few options:
this.$alexaSkill.shouldEndSession(true);
Or
this.$output.Alexa.shouldEndSession = true
Or
app.middleware('response').use((handleRequest) => {
handleRequest.$response.response.shouldEndSession = true;
});
I recommend using the SpeechBuilder for this. You can add a string in one intent handler, and then add another one in the next one. Learn more here: https://www.jovo.tech/docs/output/speechbuilder
No, shouldEndSession
is an Alexa-specific property. this.tell()
does the same, or you can set the next scene to actions.scene.END_CONVERSATION
explicitly
this.$googleAction.setNextScene('actions.scene.END_CONVERSATION');
Ok, so if I don’t want the conversation to end after the tell in Google I have to use the setNextScene?
Sometimes I’m in a situation where I want to say something to the user but I don’t need an answer back, is there anything else that I can use?
I’ve ended up using @jan’s idea of using the speech builder. I add some text in one intent, then forward to another, add some more stuff and then call .tell or .ask.