actions-on-google / actions-on-google-nodejs

Node.js client library for Actions on Google
https://actions-on-google.github.io/actions-on-google-nodejs
Apache License 2.0
900 stars 194 forks source link

Not calling intent on option selected of list #371

Open MonarthS opened 4 years ago

MonarthS commented 4 years ago

I had created one list in intent as shown below, but when I select any option nothing happened:

const express = require("express");
const bodyParser = require("body-parser");

'use strict';

const {
  dialogflow,
  List,
 } = require('actions-on-google');

const app = dialogflow({debug: true});

// List
app.intent('mylist', (conv) => {
  conv.ask('This is an example of a list.');
  conv.ask(new List({
    items: {
      'key_1': {
        title: 'Number one',
        synonyms: ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2'],
      },
     'key_2': {
        title: 'Number two',
        synonyms: ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2'],
      }
    }
  }));
});

// Created Dialogflow intent with `actions_intent_OPTION` event
app.intent('mylist-selected', (conv, input, option) => {
  conv.close(`${option} is a selected`);

});

const expressApp = express().use(bodyParser.json());
expressApp.post("/", app);
expressApp.get('/', (req, res) => {
  res.send('Dialogflow Server ')
})

expressApp.listen(process.env.PORT || 3000, () => {
  console.log("server is running");
});

Intent mylist-selected never called.

Fleker commented 4 years ago

Is the intent being called but you don't have fulfillment set up?

MonarthS commented 4 years ago

Can you give example how to do that?

I'm testing it on botcopy.

Fleker commented 4 years ago

I don't know anything about BotCopy. In Dialogflow, you'd check the Fulfillment option:

image

MonarthS commented 4 years ago

I had already done this, and also added fulfilment url, but that not working when any option is selected from list

Fleker commented 4 years ago

Do you get the same type of issue if you use Dialogflow directly?

onigetoc commented 4 years ago

I have the same issue, it do not add my own key and synonyms is empty

grapeia commented 4 years ago

Hi there,

Any news about that? I´m facing the same issue here in real devices. When I create a carousel from fullfilment and even setting the context followup to the same used in action_intent_option (to trigger the event action) the option selected is not sent to fullfilment, Instead, is sent the title text only. Using the actions console simulator in phone mode, the carousel works perfectly.

cedrickvero commented 4 years ago

Any update regarding this issue ? Using a google nest hub. When checking the tasty app, they seem to have found a way to make it work.