Update: 2026-05-06 03:16:32

This commit is contained in:
Hamza-Ayed
2026-05-06 03:16:32 +03:00
parent 3a29f26d56
commit b874b66e6b
2 changed files with 16 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ class WhatsAppProxyService
//"https://botmasa.intaleq.xyz/send", // mayar
//"https://botmasa2.intaleq.xyz/send", // shad
//"https://bootride.intaleq.xyz/send", // ramat bus
"https://bot3.intaleq.xyz/send", // shahd
// "https://bot3.intaleq.xyz/send", // shahd
"https://bot5.intaleq.xyz/send", // bot5 from postman
//"https://whatsapp.tripz-egypt.com/send" // tripz
];
@@ -28,11 +28,10 @@ class WhatsAppProxyService
* @param string $message نص الرسالة
* @return bool نجاح الإرسال
*/
public function sendMessage(string $to, string $message): bool
public function sendMessage(string $to, string $message): array
{
if (empty($this->servers)) {
error_log("[WhatsAppProxyService] No servers available.");
return false;
return ['success' => false, 'error' => 'No servers available.'];
}
// اختيار سيرفر عشوائي من القائمة المتاحة لتوزيع الحمل
@@ -62,17 +61,18 @@ class WhatsAppProxyService
curl_close($curl);
if ($err) {
error_log("[WhatsAppProxyService] cURL Error on $url: $err");
return false;
return ['success' => false, 'error' => $err, 'url' => $url];
}
$responseData = json_decode($response, true);
if (!isset($responseData['success']) || $responseData['success'] !== true) {
error_log("[WhatsAppProxyService] API Error on $url: " . $response);
return false;
}
$isSuccess = isset($responseData['success']) && $responseData['success'] === true;
return true;
return [
'success' => $isSuccess,
'response' => $responseData,
'raw_response' => $response,
'url' => $url,
'payload' => $payload
];
}
}