Код: Выделить всё
if ($callback == 'callback_camera1') {
$url = gg("hallCam.snapshotURL");
$image = ROOT."/cached/snapshot.jpg";
file_put_contents($image, file_get_contents($url));
$msg = "Камера 1";
$msg .= " - " . date("d.m.y H:i:s");
$keyb = $this->buildInlineKeyBoard(array(array($this->buildInlineKeyboardButton('Обновить',"","callback_camera1",""))));
$img = curl_file_create($image, 'image/png');
$photo = array('caption' => $msg, 'type' => 'photo', 'parse_mode'=> 'HTML', 'media' => 'attach://'.basename($image));
$content = array('chat_id' => $chat_id, 'message_id' => $message_id, 'media' => json_encode($photo,true), 'reply_markup' => $keyb);
$content[basename($image)]=$img;
$this->sendContent($content,"editMessageMedia",true);
}
Добавлена функция editImage, теперь пример будет выглядеть так:
Код: Выделить всё
if ($callback == 'callback_camera1') {
$url = gg("hallCam.snapshotURL");
$image = ROOT."/cached/snapshot.jpg";
file_put_contents($image, file_get_contents($url));
$msg = "Камера 1";
$msg .= " - " . date("d.m.y H:i:s");
$keyb = $this->buildInlineKeyBoard(array(array($this->buildInlineKeyboardButton('Обновить',"","callback_camera1",""))));
$this->editImage($chat_id,$message_id,$image,$msg,$keyb);
}