php-telegram-bot / core

PHP Telegram Bot based on the official Telegram Bot API
MIT License
3.9k stars 955 forks source link

sendDocument doesn't have option to specify only file_id as String to send a file that exists on the Telegram servers #1436

Open nightrider77 opened 11 months ago

nightrider77 commented 11 months ago

According to Telegram's API, https://core.telegram.org/bots/api#senddocument sendDocument method can accept document or file_id as a reference to a file which already exists on their servers. Current version of php-telegram-bot doesn't support to pass file_id to this method, only path to local document.

Hitmare commented 10 months ago

Hello

I can confirm that the bot supports file ID as well since i have it in use as well. How did you test it if i may ask ?

noplanman commented 10 months ago

@nightrider77 Note that the file ID is locked to the bot that created it in the first place, so you can use the file ID from a file uploaded with a different bot. (As far as I recall)