This commit is contained in:
baodev0
2026-07-21 08:34:15 +07:00
parent 3f477a559d
commit c3b5417b19
19 changed files with 652 additions and 20 deletions
+19
View File
@@ -161,6 +161,25 @@ class Telegram
return $this->SendMessage($msg);
}
/**
* Notify one step of the VM rebuild pipeline (success or failure).
*/
public function SendRebuildStepNotification(string $vmName, string $ip, string $step, bool $success, ?string $note = null)
{
$msg = ($success ? '🔄' : '❌') . " Rebuild VPS — {$step}\n";
$msg .= "--------------------------------\n";
$msg .= "🖥️ VM: {$vmName}\n";
$msg .= "🌐 IP: {$ip}\n";
$msg .= "📊 Trạng thái: " . ($success ? 'Hoàn tất ✅' : 'Thất bại ❌') . "\n";
if ($note) {
$msg .= "📝 " . ($success ? 'Ghi chú' : 'Lỗi') . ": {$note}\n";
}
$msg .= "🕒 Thời gian: " . Carbon::now()->format('d/m/Y H:i:s') . "\n";
$msg .= "--------------------------------";
return $this->SendMessage($msg);
}
/**
* Send a photo to Telegram group
* @param string $filePath Local storage path (e.g. Upload/2024/06/01/image.png)