Unable to send replies/messages using Twilio driver
mazeeblanke opened this issue · comments
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>
');
});`
I have same issue,
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.
@yossyrey it's working for me now, i will create a simple repo/example. I guess the issue had to do with heroku (not sure tho) because i got it working on ngok
@yossyrey here is a working example https://github.com/mazeeblanke/botman-twilio-web-example. Hope it helps.