protected static function encodeFile($file) { $fp = fopen($file, 'r'); if ($fp === false) { throw new TelegramException('Cannot open ' . $file . ' for reading'); } return $fp; }