irazasyed / telegram-bot-sdk

🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
https://telegram-bot-sdk.com
BSD 3-Clause "New" or "Revised" License
3.04k stars 671 forks source link

problem to send photo and open mp3 file #1141

Open kia1349 opened 2 months ago

kia1349 commented 2 months ago

PHP version

8.1

irazasyed/telegram-bot-sdk version

3.14

Laravel version (if any)

No response

Code To Reproduce the bug

function sendReminder($chatId, $message, $audioFile) { global $telegram; $telegram->sendAudio([ 'chat_id' => $chatId, 'audio' => new CURLFile($audioFile), // فایل صوتی را به صورت CURLFile ارسال کنید 'caption' => $message, ]); }

$filePath = realpath('test.png'); // Get the absolute path
// Send the image using CURLFile
$response = $telegram->sendPhoto([
    'chat_id' => $chatId,
    'photo' => new CURLFile($filePath),
    'caption' => 'Here is the image.'
]);

can anyone help me?

Error stacktrace (if any)

No response

archond commented 1 month ago

i have a same problem