Last active
August 18, 2022 09:46
-
-
Save savelee/7485763b67e6ee3a5d00aa07c8678f94 to your computer and use it in GitHub Desktop.
Actions on Google for Google Cloud Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { | |
dialogflow | |
} = require('actions-on-google'); //version 2.1.1 | |
const assistantHandler = (conv) => { | |
console.log('Dialogflow Request headers: ' + JSON.stringify(conv.headers)); | |
console.log('Dialogflow Request body: ' + JSON.stringify(conv.body)); | |
conv.ask("Hello World"); | |
}; | |
const welcomeHandler = (conv) => { | |
conv.ask("Welcome"); | |
}; | |
const app = dialogflow(); | |
app.intent('Welcome Intent', welcomeHandler); | |
app.intent('My Custom Intent', assistantHandler); | |
exports.index = app; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment