Download the PHP package scaletta/botman-driver-dialogflow without Composer
On this page you can find all versions of the php package scaletta/botman-driver-dialogflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download scaletta/botman-driver-dialogflow
More information about scaletta/botman-driver-dialogflow
Files in scaletta/botman-driver-dialogflow
Package botman-driver-dialogflow
Short Description Dialogflow fulfillment driver for BotMan with Fixes
License MIT
Homepage http://github.com/scaletta/botman-driver-dialogflow
Informations about the package botman-driver-dialogflow
BotMan Dialogflow Driver with Fixes
BotMan driver to handle Dialogflow fulfillment with BotMan. The original repo is not maintained anymore, no answers on pullrequests. As for that reason i forked it with fixes. The main fix right now is to be able to provide Outgoing Context to DialogFlow.
It uses eristemena/dialog-fulfillment-webhook-php
library, so it supports v1 and v2 of Dialogflow request.
Installation & Setup
First you need to pull in the Driver.
If you're using BotMan Studio, that's pretty much it.
But if you don't, then load the driver before creating the BotMan instance:
Usage
Hearing Messages
You can start receiving message using hears()
based on the Intent of the message,
Single Message Reply
The simplest way to reply to an incoming message is using BotMan's own reply()
method:
Add Outgoing Context
To make use of parameters in DialogFlow you can use outgoing context
Multiple Message Replies
Normally when you want to send multiple replies, you use reply()
multiple times. Unfortunately this doesn't work for Dialogflow driver, cause the messages should be in a single response payload.
For that, you have to use specific methods for this driver addMessage()
and sendMessage()
as follow,
Rich Messages
Text
Use Dialogflow\RichMessage\Text
Image
Use Dialogflow\RichMessage\Image
Card
Use Dialogflow\RichMessage\Card
Quick Replies
Use Dialogflow\RichMessage\Suggestion
Custom Payload
All versions of botman-driver-dialogflow with dependencies
botman/botman Version ~2.1
eristemena/dialogflow-fulfillment-webhook-php Version ~1.3