botman / driver-facebook

BotMan Facebook Messenger Driver
MIT License
71 stars 72 forks source link

Working with Facebook Built-in NLP and customized with Wit.ai #76

Closed sakibulalam closed 5 years ago

sakibulalam commented 5 years ago

Facebook Built-in NLP and that customized with Wit.ai provides the NLP data with the request. How to define the responses of the bot using these?

christophrumpel commented 5 years ago

This not specifically supported in BotMan so far. What you can do is grab the information by getting the full payload of the message with $bot->getMessage()->getPayload();.

sakibulalam commented 5 years ago

Can this be done with a custom middleware to achieve something like what is described in the documentation (link)? I will parse the payload and set the intent that can be picked up by $botman->hears().

christophrumpel commented 5 years ago

Yeah you can do this with a middleware. There you can chech the whole payload and if there is an intent inside you can change the content of the message to something you can listen for.