Skip to content

Instantly share code, notes, and snippets.

@marcorei
Created January 7, 2018 13:05
Show Gist options
  • Save marcorei/0f9d555232a67edc54947d93b4d60d5d to your computer and use it in GitHub Desktop.
Save marcorei/0f9d555232a67edc54947d93b4d60d5d to your computer and use it in GitHub Desktop.
function buildOptionItem(app: DialogflowApp, aString: string): Responses.OptionItem {
// Provide a key which is unique to each option.
// And synonyms that the user can say alternativly to the title
return app.buildOptionItem(`KEY_${aString}`, aString)
.setTitle(`Option ${aString}`)
// Description and image are optional.
.setDescription(`Description for ${aString}`)
.setImage('https://example.com/image.jpg', 'An image')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment