Dialogflow messenger-referrals - node.js

I'm trying to get the GET_STARTED payload with reference parameters firing to my chatbot running on a node express.js instance.
If I do a get started with refereral call with no active conversation thread, I can access the parameters no problem.
The issue is, however, if I click on a referral link with a conversation thread with my bot already open. I get no post to my fulfillment server.
I have enabled messaging_referrals within the facebook developer console, is there some Intent or Event I need to create within the dialogflow console to pass it to my webhook?
For Context:
Messenger ref parameter is not passed to dialogflow
https://productforums.google.com/forum/#!msg/dialogflow/oldK752j-Ok/GrwJajfwBAAJ
https://developers.facebook.com/docs/messenger-platform/reference/webhook-events/messaging_referrals#customer-chat
https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links/

In case anyone stumbles upon this in the future, I received a reply from DialogFlow support, stating that they don't support this functionality.

Related

How to create a bot in lex/azure that respond in slack threads?

I have created 2 chatbots using AWS lex and Azure bot framework each. I have integrated them with slack and they respond to the mentions in channels.
Currently, the bot responds as a new message however I want it to respond in the slack thread of the original message posted by the user. I tried to look for articles in various places but could not find anything helpful. Does anyone have any idea on how to achieve this or a reference to a GitHub repo for a sample?
Since you are able to post replies, I am assuming that you are using chat.postMessage API.
https://api.slack.com/methods/chat.postMessage
To send the reply as a thread, all you need to do is that add thread_ts argument in the api call.
(Provide original message's ts (timestamp) value to make this message a reply.)

Act on non-text telegram messages in Google Dialogflow. Fallback intent should forward everything

I'm building a chatbot with Telegram and Google Dialogflow. When I integrate Dialogflow into Telegram via the Dialogflow "Integrations" tab, Dialogflow registers as a Webbhook service to intercept all received Telegram messages. Unfortunately, I cannot act on non-text messages like stickers, images and Telegram payment checkout messages.
I wish Dialogflow would forward all the received messages to my custom fulfillment webhook in the Fallback intent. In my webhook, I would be able to parse the received body and act on the unsupported telegram messages accordingly.
I know that there is a FACEBOOK_MEDIA event in Dialogflow. This event is fired when an image is sent via a Facebook messenger to Dialogflow. Is there something like a TELEGRAM_MEDIA or even a TELEGRAM_UNSUPPORTED event available?
I would really like to be able to act on more than just text messages in Dialogflow.
Do I need to add another layer between Telegram and Dialogflow to be able to act on all Telegram messages?
What I have analyzed so far:
I forward all Google Dialogflow interaction logs to Google Cloud stackdriver. It seems as if non-text messages are completely ignored by Dialogflow. I see no log entry at all when I send a non-text message to my telegram bot. On the other hand, when I send a text, the log and its JSON payload appears immediately in the stackdriver.
I created a fallback intent in Dialogflow and enabled "Enable webhook call for this intent" in the Fulfillment section. Unfortunately, my fulfillment function doesn't fire on any non-text events. Dialogflow blocks it in the first place.
For future reference, I will try to give a possible, but not an out-of-the-box solution to my own question. If someone has a better solution, this would be great.
It seems to me, that at the moment of writing this, a full interaction experience is only possible by implementing an intermediate layer between Telegram and Dialogflow. Telegram might contact this intermediate layer, which processes the received message and uses the Dialogflow SDK/API for the Google NLP goodness. For the (not yet) supported Telegram messages this intermediate layer must implement its own logic.
Currently, there seems to be no way to handle non-telegram text messages via dialogflow, however there is an open report about it here if it may interest https://issuetracker.google.com/issues/157202508

How to show a greeting message when BOT starts api.ai / dialogflow in App

I am creating a BOT in Dialogflow on Android.
I want to show a greeting message every time user launches the app.
How to achieve this ?
You just need to mention in the default welcome intent or add an event for that particular intent. If you're using Dialogflow with kommunicate then to show different welcome messages on different pages of your website. Please refer to this doc for info.
You can create a welcome event and when user first time opens the chatbot you have to send just event name in parameter there is no need for the query parameter.
There is provision to do so in api.ai. The event is a feature that allows you to invoke intents by an event name instead of a user query. You just need to define event names for intents. Then, you can trigger these intents by sending a /query request containing an event parameter. Please read the document here: https://dialogflow.com/docs/events

API.AI A bot that starts the conversation

I am just now creating my first bot for my own use, and I want
to gather user information and search through my database for it.
I figured the best way for this is just to ask the question before the user
starts the conversation. Does anyone know how I can accomplish this (getting the bot to send a message first)?
Trigger an event as soon as user comes to the chat bot platform - see https://api.ai/docs/events. Nearly all platforms triggers an event for users first time. Check the facebook bot docs.
There is provision to do so in api.ai. The event is a feature that allows you to invoke intents by an event name instead of a user query. You just need to define event names for intents. Then, you can trigger these intents by sending a /query request containing an event parameter.

How to detect bot message/user message?

My FB-NodeJS-API prototype is not working correctly because my webhook is receiving the bot respond which is then sent to API.AI.
I need to set a condition where only a user's message should be received on the webhook request or only user's message should be sent to API.AI.
Can anyone advise me on this?
Can you explain the problem better? Please add the relevant code.
The bot response should go the user, not the webhook. The user input will come to the webhook.
I would suggest getting the bot to work without API.AI first and then adding support. My bot is in node.js so you may just want to jump to the source code.
For more information on setting up a bot see my article Facebook Bots for Fun and Profit
The example bot is DMS Software Bot
The source code is Github fb-robot

Resources