为了账号安全,请及时绑定邮箱和手机立即绑定

使用 PHP Telegram Bot InputMediaPhoto 方法

使用 PHP Telegram Bot InputMediaPhoto 方法

PHP
www说 2023-08-11 17:42:33
我试图用我的 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 关注
  • 86 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信