PHPackages                             eristemena/botman-driver-dialogflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. eristemena/botman-driver-dialogflow

ActiveLibrary[API Development](/categories/api)

eristemena/botman-driver-dialogflow
===================================

Dialogflow fulfillment driver for BotMan

0.0.2(8y ago)10433[2 issues](https://github.com/eristemena/botman-driver-dialogflow/issues)MITPHPPHP &gt;=7.0

Since May 14Pushed 8y ago4 watchersCompare

[ Source](https://github.com/eristemena/botman-driver-dialogflow)[ Packagist](https://packagist.org/packages/eristemena/botman-driver-dialogflow)[ Docs](http://github.com/eristemena/botman-driver-dialogflow)[ RSS](/packages/eristemena-botman-driver-dialogflow/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (4)Used By (0)

BotMan Dialogflow Driver
========================

[](#botman-dialogflow-driver)

BotMan driver to handle Dialogflow fulfillment with [BotMan](https://github.com/botman/botman).

[![Build Status](https://camo.githubusercontent.com/26ebe9973c96994fba7ecefd9cb5dbbe3df69cdbd6db6f67449f3c99379e8c27/68747470733a2f2f7472617669732d63692e6f72672f6572697374656d656e612f626f746d616e2d6472697665722d6469616c6f67666c6f772e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eristemena/botman-driver-dialogflow)[![codecov](https://camo.githubusercontent.com/42e0e605d99c47d9b2f6cd28f5dd71696903cd11cef8da50a772d63f15395652/68747470733a2f2f636f6465636f762e696f2f67682f6572697374656d656e612f626f746d616e2d6472697665722d6469616c6f67666c6f772f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/eristemena/botman-driver-dialogflow)[![StyleCI](https://camo.githubusercontent.com/becd8fc898ba362a0b0d683da50f673b7424fc47116904cead70fe25acacbcb5/68747470733a2f2f7374796c6563692e696f2f7265706f732f3133333238313731302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/133281710)

It uses [`eristemena/dialog-fulfillment-webhook-php`](https://github.com/eristemena/dialog-fulfillment-webhook-php) library, so it supports v1 and v2 of Dialogflow [request](https://dialogflow.com/docs/reference/v2-comparison).

Installation &amp; Setup
------------------------

[](#installation--setup)

First you need to pull in the Driver.

```
composer require eristemena/botman-driver-dialogflow

```

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:

```
DriverManager::loadDriver(\BotMan\Drivers\Dialogflow\DialogflowDriver::class);

// Create BotMan instance
BotManFactory::create([]);

```

Usage
-----

[](#usage)

### Hearing Messages

[](#hearing-messages)

You can start receiving message using `hears()` based on the [Intent](https://dialogflow.com/docs/intents) of the message,

```
$botman->hears('Intent Name', function ($botman) {
    // replies here
});

```

### Single Message Reply

[](#single-message-reply)

The simplest way to reply to an incoming message is using BotMan's own `reply()` method:

```
$botman->hears('Default Welcome Intent', function ($botman) {
    $botman->reply('Hi, welcome!');
});

```

### Multiple Message Replies

[](#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](https://dialogflow.com/docs/fulfillment#response) payload.

For that, you have to use specific methods for this driver `addMessage()` and `sendMessage()` as follow,

```
$botman->hears('Default Welcome Intent', function ($botman) {
    $botman->addMessage('Good morning');
    $botman->addMessage('How may i help you?');
    $botman->sendMessage();
});

```

### Rich Messages

[](#rich-messages)

#### [Text](https://dialogflow.com/docs/rich-messages#text)

[](#text)

Use [`Dialogflow\RichMessage\Text`](https://github.com/eristemena/dialog-fulfillment-webhook-php/blob/master/docs/RichMessage/Text.md)

```
    $text = Text::create()
        ->text('Hello')
        ->ssml('

                Hello!

        ')
    ;

    $botman->reply($text);

```

#### [Image](https://dialogflow.com/docs/rich-messages#image)

[](#image)

Use [`Dialogflow\RichMessage\Image`](https://github.com/eristemena/dialog-fulfillment-webhook-php/blob/master/docs/RichMessage/Image.md)

```
    $image = Image::create('https://picsum.photos/200/300');
    $botman
        ->addMessage('This is an image')
        ->addMessage($image)
        ->sendMessage()
    ;

```

#### [Card](https://dialogflow.com/docs/rich-messages#card)

[](#card)

Use [`Dialogflow\RichMessage\Card`](https://github.com/eristemena/dialog-fulfillment-webhook-php/blob/master/docs/RichMessage/Card.md)

```
    $card = Card::create()
        ->title('This is title')
        ->text('This is text body, you can put whatever here.')
        ->image('https://picsum.photos/200/300')
        ->button('This is a button', 'https://docs.dialogflow.com/')
    ;

    $botman
        ->addMessage('This is a card')
        ->addMessage($card)
        ->sendMessage()
    ;

```

#### [Quick Replies](https://dialogflow.com/docs/rich-messages#quick_replies)

[](#quick-replies)

Use [`Dialogflow\RichMessage\Suggestion`](https://github.com/eristemena/dialog-fulfillment-webhook-php/blob/master/docs/RichMessage/Suggestion.md)

```
    $suggestion = Suggestion::create(['Tell me a joke', 'Tell me about yourself']);

    $botman
        ->addMessage('Hi, how can i help you with?')
        ->addMessage($suggestion)
        ->sendMessage()
    ;

```

#### [Custom Payload](https://dialogflow.com/docs/rich-messages#custom_payload)

[](#custom-payload)

Use [`Dialogflow\RichMessage\Payload`](https://github.com/eristemena/dialog-fulfillment-webhook-php/blob/master/docs/RichMessage/Payload.md)

```
    $payload = Payload::create([
        'expectUserResponse' => false
    ]);

    $botman
        ->addMessage('Have a good day')
        ->addMessage($payload)
        ->sendMessage()
    ;

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2970d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1290321?v=4)[Eris Ristemena](/maintainers/eristemena)[@eristemena](https://github.com/eristemena)

---

Top Contributors

[![eristemena](https://avatars.githubusercontent.com/u/1290321?v=4)](https://github.com/eristemena "eristemena (5 commits)")

---

Tags

botbotmandialogflowbotBotmanDialogflow

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eristemena-botman-driver-dialogflow/health.svg)

```
[![Health](https://phpackages.com/badges/eristemena-botman-driver-dialogflow/health.svg)](https://phpackages.com/packages/eristemena-botman-driver-dialogflow)
```

###  Alternatives

[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)[botman/driver-slack

Slack driver for BotMan

51270.2k2](/packages/botman-driver-slack)[genkovich/dialog-flow-bot-man-middleware

Middleware for BotMan (BotMan Studio). Integration with DialogFlow API v2.

122.2k](/packages/genkovich-dialog-flow-bot-man-middleware)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
