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

Fulfillment answers don't reach Telegram, Facebook and Slack integration #397

Closed TiagoGouvea closed 4 years ago

TiagoGouvea commented 4 years ago

I created a simple bot to test some new resources, but I'm facing an issue with fulfillment responses on some clients. I'm testing with many integrations.

I wrote two intents to test:

  1. "Hello" - Text Response Intent
  2. "Hi" - Fulfillment Intent answered by node using actions-on-google package.

What happened:

Node code:

const { dialogflow } = require('actions-on-google');
const app = dialogflow({ debug: true });
... 

app.intent('Hi', conv => {
  console.log('>> Hi Fulfillment reached');
  conv.ask(`Hi! I'm a fulfillment response on node!`);
});

Node response (console output):

>> Hi Fulfillment reached
Response {
  "status": 200,
  "headers": {
    "content-type": "application/json;charset=utf-8"
  },
  "body": {
    "payload": {
      "google": {
        "expectUserResponse": false,
        "richResponse": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "Hi! I'm a fulfillment response on node!"
              }
            }
          ]
        }
      }
    }
  }
}
POST /api/chatBot/ 200 156 - 1419.611 ms

I recorded my screen to show better that behavior.

ezgif-2-8a0aac31033e

I also posted this as a question on StackOverflow

Fleker commented 4 years ago

This library is not designed to work with any platform other than Actions on Google. If you are looking at hosting your application on other platforms, you would do better to use dialogflow-fulfillment which should be more generalized.

TiagoGouvea commented 4 years ago

Ok. Got it. Thank you @Fleker !