PHP code example of genkovich / dialog-flow-bot-man-middleware
1. Go to this page and download the library: Download genkovich/dialog-flow-bot-man-middleware library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
genkovich / dialog-flow-bot-man-middleware example snippets
php
$dialogflow = \BotMan\Middleware\DialogFlow\V2\DialogFlow::create('en');
$botman->middleware->received($dialogflow);
$botman->hears('smalltalk.(.*)', function ($bot) {
$extras = $bot->getMessage()->getExtras();
$bot->reply($extras['apiReply']);
})->middleware($dialogflow);
php
$dialogflow = DialogFlow::create('en')->ignoreIntentPattern();