Answer the question
In order to leave comments, you need to log in
How to send a file in Telgram bot by id?
https://core.telegram.org/bots/api#sending-files
https://github.com/irazasyed/telegram-bot-sdk/blob...
The telegram API says you can use file_id to send a file.
The library method says that you can actually send a file by file_id.
The link to the file is sent without problems.
$url = 'files/video.MP4';
$response = $telegram->sendDocument(['chat_id' => $chat_id, 'document' => InputFile::create($url)]);
$response = $telegram->sendDocument([
'chat_id' => $chat_id,
'document' => 'BAACAgIAAxkDAAPLXt765mi26pbaCsuwarR-4Vpg1GPlKR3DgfhB75rgaBA'
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question