1

except for google assistant app, all of my integrations are responding with static default response instead of custom fulfillment that i hosted on my server. i already checked request and response json from dialogflow to my server, they are fine... when i make request from skype, the response from my server does have the custom fulfillment message but instead the skype is showing static response for skype that i wrote i the default text message tab for my intent. please let me know what i need to do. thanks

Expected Conversation through (Skype) User: some words in english Agent(From Fulfillment): English, this is response is for english

Actual Conversation i am getting: User: some words in english Agent(from dialogflow static text response): Hello.. i am default response from skype

Note this is only happening in facebook messenger, skype(these are the only integrations i've enabled) but not on dialogflow simulator and actions on google simulator.

I think this problem is from dialogflow end because both facebook messenger and skype produce the same behavior

    const express = require('express')
const bodyParser = require('body-parser')
const {dialogflow,
  Permission,
Suggestions,
Carousel,
BrowseCarouselItem,
BrowseCarousel,
Image,}= require('actions-on-google')

const request = require('request')
const dialogflowapp = dialogflow()
const app = express()
app.use(bodyParser.json())
app.set('port', (process.env.PORT || 5000))



const LANGUAGE_INTENT = 'Languages';
const LANGUAGE_TYPE_ENTITY = 'LanguageType';
dialogflowapp.intent(LANGUAGE_INTENT, (conv) => {
     const quote_type = conv.parameters[LANGUAGE_TYPE_ENTITY].toLowerCase();
     if (quote_type === "telugu") {
     conv.ask("Telugu, This response is for telugu");
     } else if (quote_type === "english") {
     conv.ask("English, this is response is for english");
     } else if (quote_type === "hindi") {
     conv.ask("Hindi, this response is for Hindi");
     } else {
         conv.ask("Cann't understand bro");
     }
});
dialogflowapp.catch((conv, error) => {
  console.error(error);
  conv.ask('Something went wrong!');
});


app.post('/webhook',(req,res, next)=>{
  console.log(req.body);
  next();
}, dialogflowapp);

app.listen(app.get('port'), function () {
  console.log('* Webhook service is listening on port:' + app.get('port'))
Baji shaik
  • 37
  • 5

1 Answers1

0

The issue is that you're using the actions-on-google library for fulfillment, which only creates results that are valid on the Google Assistant.

If you want to send back a reply that is valid for other Dialogflow integrations, you will need to use the dialogflow-fulfillment library.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • yes, thank you. i guess i mixed up code from multiple tutorials i have gone through. i am trying to get location of user(food ordering bot), it works fine on google assistant, but not on facebook messenger, do i have write separate logic for each integration to get the location? – Baji shaik Jan 10 '19 at 04:54
  • Glad it helps. If you have a different question, go ahead and ask a new question on StackOverflow. – Prisoner Jan 10 '19 at 09:52
  • i just did, can you take a look at this? https://stackoverflow.com/questions/54156935/setting-context-with-list-of-objects-as-prameters-in-dialogflow – Baji shaik Jan 12 '19 at 06:41