From f57be401aec314c06c33f110e61f1016f4c0aa60 Mon Sep 17 00:00:00 2001 From: mercury Date: Tue, 6 Jun 2023 22:51:41 +0400 Subject: [PATCH] improve notify update --- app/bot.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/bot.php b/app/bot.php index 6eb48c9..6e2994a 100644 --- a/app/bot.php +++ b/app/bot.php @@ -557,9 +557,11 @@ class Bot $last = file_get_contents('https://raw.githubusercontent.com/mercurykd/vpnbot/master/version'); if (!empty($last) && $last != $this->last && $last != $current) { $this->last = $last; - $diff = implode("\n", array_diff(explode("\n", $last), explode("\n", $current))); - foreach ($c['admin'] as $k => $v) { - $this->send($v, "update:\n$diff"); + $diff = implode("\n", array_slice(explode("\n", $last), 0, count(explode("\n", $last)) - count(explode("\n", $current)))); + if (!empty($diff)) { + foreach ($c['admin'] as $k => $v) { + $this->send($v, "update:\n$diff"); + } } } }