Code Monkey home page Code Monkey logo

driver-twilio's Introduction

BotMan

Latest Version on Packagist Build Status codecov Scrutinizer Code Quality Packagist StyleCI Slack Monthly Downloads

https://phppackagedevelopment.com

If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course.

About BotMan

BotMan is a framework agnostic PHP library that is designed to simplify the task of developing innovative bots for multiple messaging platforms, including Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger and WeChat.

$botman->hears('I want cross-platform bots with PHP!', function (BotMan $bot) {
    $bot->reply('Look no further!');
});

If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course.

Documentation

You can find the BotMan documentation at https://botman.io.

Stand Alone Configuration

If you are installing Botman in a stand alone Laravel application, you can publish the configuration file with the following command:

php artisan vendor:publish --tag=config --provider="BotMan\BotMan\BotManServiceProvider"

Support the development

Do you like this project? Support it by donating

Contributing

Please see CONTRIBUTING for details.

0 1 2 3 4 5 6 7

Security Vulnerabilities

If you discover a security vulnerability within BotMan, please send an e-mail to Marcel Pociot at [email protected]. All security vulnerabilities will be promptly addressed.

License

BotMan is free software distributed under the terms of the MIT license.

driver-twilio's People

Contributors

crynobone avatar danielmadu avatar mpociot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

driver-twilio's Issues

twilio driver never send replies messages

i just new using botman.
I have issue with twilio driver,
i just do all samples for twilio driver in docs, but seems it never send message to a number.

require_once 'vendor/autoload.php';
use BotMan\BotMan\BotMan;
use BotMan\BotMan\BotManFactory;
use BotMan\BotMan\Drivers\DriverManager;
$config = [
'twilio' => [
'token' => '####'
]
];
DriverManager::loadDriver(\BotMan\Drivers\Twilio\TwilioVoiceDriver::class);
DriverManager::loadDriver(\BotMan\Drivers\Twilio\TwilioMessageDriver::class);
$botman = BotManFactory::create($config);
$botman->hears('hello', function($bot) {
$bot->reply('Hello too');
});
$botman->fallback(function($bot) {
$bot->reply('Sorry, I did not understand these commands..');
});
$botman->listen();
no error, but it never send msg back to a number.
anyone can help, maybe give sample working for non laravel version.

Unable to send replies/messages using Twilio driver

I just started using botman, i am able to get it working with the web driver.
However, when i try to use the twilio driver, it does not work.

I also noticed that if i return a traditional laravel response with the twilio xml content format, it works!, but when i try to use the 'botman' way of replying using $bot->reply('sdsd') nothing happens.

From my debugging so far, i can tell that the fallback method is triggered, but no response :(

here is a snippet of the code that is not working:

`Route::post('/p', function (Request $request) {

$botman = app('botman');

$botman->reply('skdsdj fjd hfkjs');

$botman->fallback(function($bot) {

    $bot->reply('Message');

});

$botman->listen();

});`

This works tho, but not the 'botman' way :

`Route::post('/p', function (Request $request) {

return response('
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Message>This my first msg.</Message>
    <Message>This is jdjkfjd fkdjfkdj.</Message>
</Response>

');

});`

default install results in "Class 'Twilio\Twiml' not found" errors

I have a brand-new Botman installation.

Installing the Twilio driver via the instructions at https://botman.io/2.0/driver-twilio and doing a simple:

$this->say('Welcome!');

in a test conversation initiated via:

$botman->on(TwilioVoiceDriver::INCOMING_CALL, function($payload, $bot) {
    $bot->startConversation(new Conversations\SupportRequest);
});

results in the following error:

Class 'Twilio\Twiml' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'Twilio\Twiml' not found at /Users/ceejayoz/Multibrain/phonetree/vendor/botman/driver-twilio/src/TwilioVoiceDriver.php:123

It appears the driver code does not function with the Twilio SDK version being required; it's code against an older SDK, perhaps v4? #9 appears to include the adjustments necessary (using Twilio\TwiML\VoiceResponse instead of Twilio\Twiml), but at this time, the driver doesn't appear to function as installed via Botman's docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.