Skip to content

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

@dimar7

Description

@dimar7
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions