2017 © Pedro Peláez
 

library sdk-php-chatfuel-socola

class gender json for chatbot facebook chatfuel

image

socola/sdk-php-chatfuel-socola

class gender json for chatbot facebook chatfuel

  • Tuesday, February 20, 2018
  • by Socola Đại Ca
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 11 % Grown

The README.md

SDK-Php-Chatfuel-Socola

SDK Php Chatfue Socola
Using php to generate JSON for Chatfuel bot, (*1)

Create bot

use Socola\Chatfuel;
$bot = new Chatfuel();

Send text

$text = 'Socola';
$texts = [$text, $text, $text, $text];
$bot->sendText($text);
$bot->sendText($texts);

Send image

$image = 'http://i.imgur.com/luWlRwV.jpg';
$images = [
    'http://i.imgur.com/luWlRwV.jpg',
    'http://i.imgur.com/luWlRwV.jpg'
];
$bot->sendImage($image);
$bot->sendImage(images);

Send file

$file = 'https://01b02091.ngrok.io/test.pdf';
$files = array(
    'https://01b02091.ngrok.io/test.pdf',
    'https://01b02091.ngrok.io/test.pdf'
);
$bot->sendFile($file);
$bot->sendFile($files);

Send audio

$audio = 'https://01b02091.ngrok.io/test.mp3';
$audios = [
    'https://01b02091.ngrok.io/test.mp3',
    'https://01b02091.ngrok.io/test.mp3'
];
$bot->sendAudio($audio);
$bot->sendAudio($audios);

Create a button

Create Button To URL

$title = "button to url";
$url = "http://www.facebook.com";
$buttonToURL = $bot->createButtonToURL($title, $url, $setAttributes = Null);

Create Button To Block

$title = "button to block";
$block = "re-start";
$buttonToBlock = $bot->createButtonToBlock($title, $block, $setAttributes = Null);

Create Button Share

$buttonShare = $bot->createButtonShare();

Create Button Call

$phoneNumber = '096******5';
$buttonCall  = $bot->createButtonCall($phoneNumber, $title = 'Call');

Create Button Quick Reply

$block = 're-start';
$blocks = [
    'play',
    'pause'
];
$bot->createButtonQuickReply($title, $block);
$bot->createButtonQuickReply($title, $blocks);

Send a text card with one or more button (max 3 buttons)

$text = 'this is text card';
$uttons = [
    $buttonToURL,
    $buttonToBlock,
    $buttonShare
];
$bot->sendTextCard($text, $button);
$bot->sendTextCard($text, $buttons);

Create element

$title    = 'this is element';
$image    = 'http://i.imgur.com/luWlRwV.jpg';
$subTitle = 'this is sub title';
$element  = $bot->createElement($title, $image, $subTitle, $button_or_arrayButtons);
$arrayElements = array(
    $element1,
    $element2
);
$bot->sendGallery($element_or_arrayElements);

Send a list template min 2 element

You can switch type “top_element_style” between “large” and “compact”., (*2)

$topElementStyle = 'large';
$bot->sendList($arrayElements, $topElementStyle);

The Versions

20/02 2018

dev-master

9999999-dev

class gender json for chatbot facebook chatfuel

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar Socola Đại Ca

20/02 2018

v1.1.1

1.1.1.0

class gender json for chatbot facebook chatfuel

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar Socola Đại Ca

05/02 2018

v1.1

1.1.0.0

class gender json for chatbot facebook chatfuel

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar Socola Đại Ca

04/02 2018

v1.0

1.0.0.0

class gender json for chatbot facebook chatfuel

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar Socola Đại Ca