botman / driver-telegram

BotMan Telegram Driver
MIT License
88 stars 75 forks source link

Is it possible to send local files (not by URL)? #100

Closed Warmbellycat closed 2 years ago

Warmbellycat commented 3 years ago

Description:

I try to add local image to OutgoingMessage and recieve error 400 from telegram. Is it possible to send local files to TG?

Steps To Reproduce:

    $attachment = new BotmanImageAttachment($image->getPathname(), ['custom_payload' => true]);
    $message = OutgoingMessage::create($messageText)->withAttachment($attachment);

Response: "{"ok":false,"error_code":400,"description":"Bad Request: wrong remote file identifier specified: Wrong character in the string"}"

vdomah commented 3 years ago

Not possible using OutgoingMessage. Need to make custom request to match sendPhoto method: https://core.telegram.org/bots/api#sendphoto

Warmbellycat commented 3 years ago

Not possible using OutgoingMessage. Need to make custom request to match sendPhoto method: https://core.telegram.org/bots/api#sendphoto

Thanks for reply. I've write my own wrapper for this driver.