Ability to Process Contacts & Locations from Meta ...
# 👀feature-requests
a
When I'm in a flow and I respond to my bot with a Contact or a Location, this isn't picked up by the flow ("Waiting for user input" is still displayed). Can we stream these special event types from Meta to Botpress since they are text (JSON-formatted representations)?
c
you can send the botpress an object type. But from external api, from conversation I don't know...
example: data = { city: "Madrid", state: "España", street: "c/cuesta", number: 25, }; param = { "type":"object", "name":data, };
In botpress you capture the parameters:
Copy code
{
  "type": "session",
  "name": "city",
  "value": "{{event.payload.name.city}}"
}
a
Great question @astonishing-accountant-44048 and thanks for responding @calm-park-34551 . I'll ask around and get back to you (I want to confirm if there is a working solution right now)!
r
@colossal-egg-20510 @acceptable-gold-88171 i think that's on the integrations side, as we're open-sourcing them people will be able to add events we miss
c
Yes, that's new events / actions that can be added to integrations once we release them publicly. 🎉
a
Once the integrations are up and running, the plan is to add special nodes in the Studio that can catch these events and redirect the user to the right location.
i
Greetings Team, What is the recommended route for me to pursue when I need my bot to receive currently non-supported response types from whatsapp like {images, audio, etc} https://botpress.com/docs/cloud/channels/whatsapp/#from-whatsapp-to-botpress
e
Hey @incalculable-bird-83091 I think it's just not possible at the moment...
@famous-zoo-73118 or @colossal-egg-20510 are there any suggestions?
f
Yes, not possible at the moment, but it's in our roadmap to add support for more Whatsapp message types
f
@early-train-33247 @famous-zoo-73118 Is it possible for me to just extract the whatsapp image id from the incoming image? I can do the rest of the work in my server-side to fetch the actual image. Currently when a user sends a message, botpress doesn't handle it and ignores it and shows that messages otf type image are unhandled in the logs.
I am using the event.payload to try and extract the id but it doesn't work because the event isn't being handled at all and is ignored. So if I send an image the conversation doesn't change, the next card isn't executed until I send something else.
So what I am asking is if it is possible to allow us to manipulate the event payload of the image from whatsapp and treat it as a normal message. This simple tweak would allow me to take images as input and I am willing to make a tutorial on it aswell if this tweak is made.
@rich-battery-69172 @colossal-egg-20510
And same goes for other document types like pdfs... If botpress can treat them as a normal message I will be able to handle all message types by extracting the id of the message and using the Facebook Graph API to fetch the image in my server-side.
e
Hey @fresh-article-37001, the detailed info is much appreciated!!
Unfortunately there is no workaround at the moment, but Processing media messages is in our backlog already!
If you are feeling scientific, you could try the following: - Create a Before Incoming Message hook that checks if the current integration is whatsapp and if there is an image in the payload. If there is, it saves the image id to a variable
- Then structure your flow like this
But I'm not sure whether sending an Image will make the bot proceed from the "Waiting for User input" card (which could be a regular Capture card) to the expression below. Let me know what you find
f
Thanks for the suggestion Guilhermy, but it still doesn't work. With message types such as text and button clicks, the middleware is being executed properly and is printing out to the console as well (A thing I added to see if it's being executed). But when I use message types such as images, the middleware is not executed. You're solution seemed perfect and it felt so close to being able to extract the whatsapp image id. Any help would be appreciated. I am willing to try the craziest workarounds to make this work.
f
Hi @fresh-article-37001, we fast tracked this and we have just released support for media messages in our Whatsapp integration. You can start using this right away, here's the documentation: https://docs.botpress.cloud/docs/cloud/channels/whatsapp/#media-images-audio-documents
q
🔥 🔥 🔥
f
Thanks alot Abe and botpress team!
7 Views