Exemplo n.º 1
0
 public function createAndSendRadarGIF($radar_code, $image_radius_code)
 {
     $radar_string = BoM::getBoMRadarString($radar_code, $image_radius_code);
     $web_image_paths = BoM::getRadarTransparencies($radar_code, $image_radius_code);
     $file_path = self::getNewLocalFilePath($web_image_paths);
     if (count($web_image_paths) < 2) {
         \GroupBot\Telegram::talk($this->chat_id, emoji(0x274c) . " Something went wrong getting the radar images fam. The radar might be down. Check here to see if it's working: \n \nhttp://www.bom.gov.au/products/" . $radar_string . ".loop.shtml#skip");
         return false;
     }
     if (!$this->telegram->sendIfExists($file_path)) {
         \GroupBot\Telegram::sendChatSendingPhotoStatus($this->chat_id);
         ImageProcessing::createBackground($radar_string);
         $images = ImageProcessing::overlay($web_image_paths, $radar_string);
         ImageProcessing::animate($images, $file_path);
         $this->telegram->sendGIFThroughTelegram($file_path);
     }
     return true;
 }