Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't attach PDF files to a reply #125

Open
dimar7 opened this issue Apr 3, 2024 · 0 comments
Open

I can't attach PDF files to a reply #125

dimar7 opened this issue Apr 3, 2024 · 0 comments

Comments

@dimar7
Copy link

dimar7 commented Apr 3, 2024

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

Description:

this is the code:

<?php
use BotMan\BotMan\BotMan;
use BotMan\BotMan\Messages\Outgoing\OutgoingMessage;
use BotMan\BotMan\Messages\Attachments\File;

$botman = resolve('botman');

$botman->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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant