Skip to content

Instantly share code, notes, and snippets.

@surajsau
Last active January 7, 2019 06:35
Show Gist options
  • Save surajsau/8966c627a19c8b38ef650ceac359fe5b to your computer and use it in GitHub Desktop.
Save surajsau/8966c627a19c8b38ef650ceac359fe5b to your computer and use it in GitHub Desktop.
'No' Follow Up intent DailyRounds Assistant
/**
* This handles the situation when user refuses to save his/her
* speciality preference. In this case, we use the fallback 'primary'.
* 'cases-followup' context has exhausted 1 lifespan. Since, it has a
* total of 2, we are safe to proceed with using it's parameters
* without first checking for availability of context.
*/
app.intent('cases_speciality_ask_no', (conv) => {
conv.ask('Not an issue, you can always save your preference later.');
const skipCount = conv.contexts.get('cases-followup').parameters.cases ? conv.contexts.get('cases-followup').parameters.cases : 5;
return fetchCasesAndDisplay(rounds_map['primary'], skipCount, conv);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment