如何通过电报BOT上传和下载照片?

时间:2019-08-21 08:12:41

标签: php telegram-bot

问题是我想通过电报bot发送消息,也可以从中下载 例子:

当我发送消息时:/ INPUT

电报会回复:请在此处输入图片

     $bot_url    =      
 (//api.telegram.org/bot879669473:AAFlNB0v9Wk7jsCmXzHAAAXESltfswrJGCUa4aTs/");
$chat_id     = '656219807436';
$get_file    = (//api.telegram.org/bot879669473:AAFlNB0v9Wk7jsCmXzHXESltfrJGCUa4aTs/            
            getFile? file_id=AgADBQAD5KgxGw6e2VbuoSeUL3qcoeuKAjMABAEAAwIAA20AA4LRAAWEWQAIWBA");
 $file_id    = 'AgADBQAD5KgxGw6e2VbuoSeUL3qcoeuKAjMABAEAAwIAA20ASWEQASAA4LRAAIWBA';
 $url        = $bot_url . "sendPhoto?chat_id=" . $chat_id ;


$message_id = $message['message_id'];
        $chat_id = $message['chat']['id'];
        $from_id = $message['from']['id'];
        $username = $message['chat']['username'];
        $photo = $message['photo']['file_id'];

 if (isset($message['text'])) {
            $text = $message['text'];
     telegram_send_message($chat_id,$photo);
 }

0 个答案:

没有答案