christophrumpel / chatbot-php-boilerplate

This package makes it simple to start building a chatbot in PHP. Give me 10 minutes of your time and I will give you a chatbot starter setup.
MIT License
118 stars 42 forks source link

Custom payload answer with Dialogflow #12

Open guidodipaolo opened 6 years ago

guidodipaolo commented 6 years ago

Hi !! It seems that when an Dialogflow Intent has a custom payload as answer, the chatbot doesnt show it.

In my particular case, in many cases, I have only custom payload answers and when it happends, i dont get any answer from the bot. If I add a text answer from Dialogflow console, the bot shows only the text answer and not the payload.

Any way to get the payload answer ?

Thanks

christophrumpel commented 6 years ago

I will give it a look today. Thx for mentioning.

christophrumpel commented 6 years ago

Hey @guidodipaolo ,

I wasn't sure if I should add it because this should be just very simple boilerplate. There are dozens of other things that could be implemented as well, but I want to focus on the purpose here. If you need more features I would check out BotMan

Still, I added it, as well as a new release. But it only works IF there is no text message in your intent included. The code now looks for the speech key. If it is empty it will try the custom payload JSON. Please try it out. Greets