botman / botman/driver-facebook

I can't attach PDF files to a reply

Open
#125 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
71
Forks
72
PR merge metrics
No merged PRs in 30d

Description

- BotMan Version: v2.6.1
- PHP Version: 7.4.12

### Description:

this is the code:

```
hears('Send PDF', function ($bot) {

$attachment = new File('/pdf/example1.pdf', [
'custom_payload' => true,
]);
$message = OutgoingMessage::create('This is your PDF')
->withAttachment($attachment);
$bot->reply($message);

});
```
It shows the message "This is your PDF" but without attachment, I tried with the full url, but doesn't work either. The pdf folder is located in the public folder. I'm using Facebook Driver.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided PDF attachment example with BotMan v2.6.1, PHP 7.4.12, and the Facebook Driver, then trace how OutgoingMessage and File attachments are handled by the driver. Done means the reply delivers both the text and the PDF attachment, including when the file uses a full URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.