botman / driver-facebook

BotMan Facebook Messenger Driver
MIT License
71 stars 73 forks source link

Message Added to an attachment does not go! #65

Closed allandereal closed 6 years ago

allandereal commented 6 years ago

Consider the code below. The message "This is a video is not sent out, though the video is". $attachment = new Video('video_url'); $message = OutgoingMessage::create('This is a Video')->withAttachment($attachment); $this->say($message);

christophrumpel commented 6 years ago

Hey @allandereal,

cannot test it right now but from what I remember you cannot add text to fb attachment. you need to write a message before or after. This is little bit misleading because of the OutgoingMessage object where you can set the text. (which works on other drivers)

You could also use the Facebook MediaTemplate from BotMan to send image / video with buttons connected. Hope that helps.

christophrumpel commented 6 years ago

I just checked it again. FB does not allow a message next to the attachment. This is different from driver to driver. You should write a second message for your text.

freescout-helpdesk commented 3 years ago

What is the proper way to send attachment via "driver-facebook"?

freescout-helpdesk commented 3 years ago

Here it is:

$message = \BotMan\BotMan\Messages\Outgoing\OutgoingMessage::create('')->withAttachment($attachment);
$botman->say($message, $channel_id, $driver_class);