botman / driver-telegram

BotMan Telegram Driver
MIT License
86 stars 75 forks source link

Is there way to send files (not images) without extending the driver? #119

Open kirchevsky opened 3 months ago

kirchevsky commented 3 months ago

Can I send CSV, XLS, PDF, or other files without rewriting the driver to get this feature?

$filePath = $this->createRatesCsv($rates);
$fileAttachment = new File($filePath, [
                'custom_payload' => false,
]);
$message = OutgoingMessage::create('Rate Data')->withAttachment($fileAttachment);
$this->bot->reply($message);

The construction like that doesn't work with both (URL or path) cases.

Someone may have had the proper piece of code not to dance with that thing.