gashey/botman-ussd-driver

Botman USSD Driver for Laravel Projects

1.0.3 2021-07-21 13:07 UTC

This package is auto-updated.

Last update: 2024-12-21 21:47:35 UTC


README

Latest Release on GitHub Software License Total Downloads

About

BotMan driver to connect the Mobiverse USSD API with BotMan

Installation

Install Botman for Laravel before installing this driver. See the Botman documentation.

Require the gashey/botman-ussd-driver package in your composer.json and update your dependencies:

$ composer require gashey/botman-ussd-driver

Add the Gashey\BotmanUssdDriver\UssdServiceProvider to your providers array:

Gashey\BotmanUssdDriver\UssdServiceProvider::class,

Add the following listener to your botman routes file:

$botman->hears(config('ussd.cancel_text', 'CANCEL'), function ($bot) {
    $bot->reply('stopped');
})->stopsConversation();

Usage

You can use the Mobiverse USSD Simulator to test your application. Supply your application url as: http://your-application.com/botman

Configuration

The defaults are set in config/botman/ussd.php. Publish the config using this command:

$ php artisan vendor:publish --provider="Gashey\BotmanUssdDriver\UssdServiceProvider"
return [

    "cancel_text" => "CANCEL",

    "network_mapping" => array('01' => 'MTN', '02' => 'VODAFONE', '03' => 'AIRTEL-TIGO', '04' => 'AIRTEL-TIGO', '05' => 'GLO'),
];

License

Released under the MIT License, see LICENSE.