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

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

Related

use dialogFlow custom payload to send image in whatsapp

Good evening!
Everything is configured with whatsapp.
I use auto reply app and dialogFlow to make a little robot that automatically responds to certain things already ordered on whatsapp. The problem is that I can only use text as an answer; I would like from dialogFlow to respond with an image. Maybe should I use custom payload?

How to notice that a message sent to dialogflow is longer than 256 characters?

I made a facebook chatbot with dialogflow. My problem is that some users write messages to my bot that are longer than 256 characters.
Dialogflow just throws an error that the character size exceeded. As the result, the user has no answer.
I don't expect dialogflow to process the input. I just want to get this information in my backend, so I can send the user to the live chat.
Please, say me it is possible (and how ;) ).
By following this you will be able to set the custom webhook => Webhook setup
Make this server live with Ngrok with temporary later on you can migrate to your server
Now you will get event in which you will find your message sent from facebook messenger.
you can write simple JS function to send only 256 character to Dialogflow Functions
str.substring(0,255)
and send it to detectIntent in dialogflow function.

Images can be received as input in Dialogflow Chatbot?

i have a Use Case where i need to receive image as input from user in dialogflow chatbot. This images is require to send in webhook request to rest end point as fulfillment.
I couldn't find anything which resembles to my requirement and also not sure whether it is supported in dialogflow or not.
Thanks in advance!
Dialogflow cannot take an image as input and map it to an intent directly. However, what you can do is process that image and send some text to dialogflow which will trigger specific intent and then proceed to perform the desired action.
You need to have a bridge between your user agent and Dialogflow, which will handle all the text/image request. It will do all the pre-processing and then call Dialogflow.
In this way, you need to send message to the messenger user using it's API's and call dialogflow using API/SDK as well.
Hope it helps.

How do i make my Chatbot Message have some seconds of delay response in dialog flow?

I'm creating a chatbot for a Facebook page to solve people's questions and I wanted to make the bot messages 1 or 2 seconds of delay between each of the bot's replies. Could someone tell me how to do it in dialog flow? I couldn't find any answer around my research so hopefully someone could help me.
This isn't possible if you're using Dialogflow's built-in rich messages. It also wouldn't be possible using only webhook fulfillment and the Dialogflow Facebook integration, as you can only deliver a full set of messages as a reply at one time, and can't specify how they are delivered.
The only way to achieve that level of control would be to build the bot yourself (perhaps using an existing Messenger bot framework), and make calls from that code to Dialogflow to handle natural language understanding.

Sending a message to user when user enters a geofence / area?

I'm making a dialogflow agent that will be integrated with various platforms (Facebook messenger, slack and maybe a few others) that will have the basic functions of a informational chatbot.
The agent will be for a specific store and I'm wondering if it's possible to trigger some sort of welcome message once the user enters the geofence (in this case, the store)?
Thanks for the help. I haven't found any documentation for this on dialogflow specifically or anywhere else so anything will be awesome.
Note: I'm am not by any means dead set of dialogflow, if AWS Lex offers something like this and it's better, I will take a look. I'm just a bit more used to dialogflow.
This cannot be achieved just by using either Lex or Dialogflow. Because at the end of the day, you are using them to integrate with Messenger/Slack/Whatsapp and these apps will (for obvious good reasons) not share the user's location information with the bot. You will need a helper app which takes the user's location permission as well and triggers the bots for you.
Keep in mind that channels like Messenger and Whatsapp have restrictions over sending messages willy-nilly to users. Messenger has a '24+1' policy Whatsapp also you can only send free form messages in the 24 hour window. But after that you can send chargeable pre-approved "hsm" message templates.

Resources