【发布时间】:2018-08-09 09:56:48
【问题描述】:
我正在尝试做的事情是从用户那里检索个人资料照片,然后用 PHP 将它们拍成另一张照片。
问题是当我使用file_id字符串发送照片时,发送给用户的所有照片都是同一张图片!
我并没有真正运行它,但我将自己的照片发送给自己以测试功能,结果是我当前的电报个人资料图片,每次。
我的代码:
<?php
define('my_id', '12345678');
$userPhotos = apiRequestJson("getUserProfilePhotos", array('user_id' => my_id, 'offset' => 0, 'limit' => 1));
apiRequestJson("sendPhoto", array('chat_id' => my_id, 'photo' => $userPhotos['photos'][0][0]['file_id']));
apiRequestJson("sendPhoto", array('chat_id' => my_id, 'photo' => $userPhotos['photos'][0][1]['file_id']));
?>
电报机器人 api 链接: https://core.telegram.org/bots/api
如果有任何帮助,我将不胜感激。
【问题讨论】:
标签: php telegram-bot