我没有将照片发送给电报api

问题描述 投票:0回答:1

我正在将irazasyed/telegram-bot-sdk库用于电报机器人。我有一个问题:我没有发送照片机器人。为什么我不明白。这是我的代码:

$chat_id = $chat->getId();

    $params = [
        'chat_id' => $chat_id,
        // 'photo' => InputFile::create($url, "new_naushnik.jpg"),
        'photo' => "https://bot.ebots.uz/public/naushnik.jpg",
        // 'photo' => $url
        // 'caption' => 'Some caption',
        // 'parse_mode' => "HTML",
    ];

    CCommon::cLog($params);

    try {
        $response = $telegram->sendPhoto($params);
        CCommon::cLog($response);
    } catch (Exception $e) {
        CCommon::cLog($e->getMessage());
    }

$response电报API:

{"<html>\r\n<head><title>400_Bad_Request<\/title><\/head>\r\n<body>\r\n<center><h1>400_Bad_Request<\/h1><\/center>\r\n<hr><center>nginx\/1_16_1<\/center>\r\n<\/body>\r\n<\/html>\r\n":""}

请帮助我

编辑sendPhoto, sendDocument, send...不起作用

php bots telegram vps
1个回答
0
投票

我找到了答案。它是sudo apt-get install php-curl

© www.soinside.com 2019 - 2024. All rights reserved.