Skip to content

Instantly share code, notes, and snippets.

@silvolu
Last active March 16, 2018 16:10
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 silvolu/8cf364631b28909176595949ceba7c16 to your computer and use it in GitHub Desktop.
Save silvolu/8cf364631b28909176595949ceba7c16 to your computer and use it in GitHub Desktop.
Using plugins with Actions on Google client library v2
const { dialogflow } = require('actions-on-google')
const { randomize, Randomization } = require('randomize')
const app = dialogflow()
.use(randomize)
app.intent('tell.greeting', conv => {
conv.ask(`The last thing I told you was ${conv.randomize.last}`)
conv.ask(new Randomization(
'How are you?',
'Are you having a good day?',
))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment