我試圖用我的 Telegram 機器人將一些圖像發送到一條消息中。我使用InputMediaPhoto方法發送,但不幸的是不起作用。這是我的代碼:$url = "https://api.telegram.org/bot" . "TOKEN" . "/InputMediaPhoto";$postContent = [ 'chat_id' => $GLOBALS['chatId'], 'media' => [ ['type'=>'photo' ,'media' => 'http://www.alcan5000.com/JPG/64Caliente.jpg'], //Just for test ['type' => 'photo' ,'media' => 'http://www.alcan5000.com/JPG/64Caliente.jpg'], ['type' => 'photo' ,'media' => 'http://www.alcan5000.com/JPG/64Caliente.jpg'] ]];post($url, $postContent);function post($url, $postContent){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POSTFIELDS, $postContent); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); curl_close($curl); return $result;}
- 0 回答
- 0 關注
- 160 瀏覽
添加回答
舉報
0/150
提交
取消