Skip to content

problem to send photo and open mp3 file #1141

Open
@kia1349

Description

@kia1349

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions