Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active August 12, 2018 12:01
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 garystafford/62385f86d32455946e16f1d5061e0a5c to your computer and use it in GitHub Desktop.
Save garystafford/62385f86d32455946e16f1d5061e0a5c to your computer and use it in GitHub Desktop.
// author: Gary A. Stafford
// site: https://programmaticponderings.com
// license: MIT License
'use strict';
/* CONSTANTS */
const {
dialogflow,
Suggestions,
BasicCard,
SimpleResponse,
Image,
} = require('actions-on-google');
const functions = require('firebase-functions');
const Datastore = require('@google-cloud/datastore');
const datastore = new Datastore({});
const app = dialogflow({debug: true});
app.middleware(conv => {
conv.hasScreen =
conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT');
conv.hasAudioPlayback =
conv.surface.capabilities.has('actions.capability.AUDIO_OUTPUT');
});
const IMAGE_BUCKET = process.env.IMAGE_BUCKET;
const SUGGESTION_1 = 'tell me a random fact';
const SUGGESTION_2 = 'help';
const SUGGESTION_3 = 'cancel';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment