How to use the actions-on-google.ActionsSdkApp function in actions-on-google

To help you get started, we’ve selected a few actions-on-google examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AbbottPlatform / abbott-framework / lib / controllers / gactions / botkit / index.js View on Github external
webserver.post('/gactions/receive', function (req, res) {
      // Now, pass the webhook into be processed
      const assistant = new ActionsSDKApp({ request: req, response: res });

      assistant.handleRequest(function (app) {
        gactions_botkit.handleWebhookPayload(req, res, app);
      });
    });
github DefinitelyTyped / DefinitelyTyped / types / actions-on-google / actions-on-google-tests.ts View on Github external
function testActionsSdk(request: express.Request, response: express.Response) {
    const app = new ActionsSdkApp({request, response});
    const actionMap = new Map();
    actionMap.set(app.StandardIntents.MAIN, () => {
        const richResponse: Responses.RichResponse = app.buildRichResponse()
            .addSimpleResponse('Hello world')
            .addSuggestions(['foo', 'bar']);
        app.ask(richResponse);
    });
    app.handleRequest(actionMap);
}
github Capgemini-AIE / bot-framework-actions-on-google / lib / fulfilment.js View on Github external
return (req, res) => {
    console.log("Inbound request to: " + req.url)
    const app = new ActionsSdkApp({
      request: req,
      response: res
    });

    app.handleRequest(fulfill(onUserSignedInHandlerProvider, conversationTimeout, shouldGetUsersNameFromGoogle));
  }
};
github googlearchive / interactive-fiction-nodejs / actionsdk.js View on Github external
expressApp.post('/', (request, response) => {
  console.log('handle post');
  const app = new ActionsSdkApp({request: request, response: response});

  const runner = runnerFactory(story, app);
  if (runner === null) {
    throw new Error('Runner not found!');
  }

  function mainIntent (app) {
    console.log('mainIntent');
    runner.started = app.data.hasOwnProperty('restore');
    runner.start();
  }

  function rawInput (app) {
    console.log('rawInput');
    if (app.getRawInput() === 'quit') {
      app.tell('Goodbye!');
github nkjm / bot-express / deprecated / messenger / google.js View on Github external
constructor(options){
        for (let p of REQUIRED_PARAMETERS){
            if (!options[p]){
                throw new Error(`Required parameter: "${p}" for Google Assistant configuration not set.`);
            }
        }

        this.project_id = options.project_id;
        this.sdk = new ActionsSdkApp({
            request: options.req,
            response: options.res
        });
    }