Closed jrafaelborja closed 2 years ago
Is it sending the image or just no response?
From my experience if there is no response at all its down to an uncaught error, anything in the error logs?
Yes, the chatbot sends the image, it is ok, but when the user make a new question just after the image shows, the chatbot stops
It seems that when you use Botman and DialogFlow as your logic, the image attached on Facebook didnt trigger any intent. I was having the same issue
Any work around for it?
Description:
Using Facebook Messenger with DialogFlow, after the chatbot sends any image stops conversation. Chatbot works fine hearing and sending text, but when send images stop conversation.
Steps To Reproduce:
use BotMan\BotMan\Middleware\ApiAi; use BotMan\BotMan\Messages\Attachments\Image; use BotMan\BotMan\Messages\Outgoing\OutgoingMessage;
$botman = resolve('botman'); $dialogflow = ApiAi::create('xxxxxxxxxx11111111111xxxxxxxxxx')->listenForAction(); $botman->middleware->received($dialogflow);
$botman->hears('.*', function ($bot) { $extras = $bot->getMessage()->getExtras(); $apiReply = $extras['apiReply']; $bot->reply($apiReply); // ADDING THIS TWO BELOW LINES CHATBOT STOPS RESPONDING $message = OutgoingMessage::create('Here is a nice image')->withAttachment(Image::url('https://www.mydomain.com/images/pic.jpg')); $bot->reply($message); })->middleware($dialogflow);