period check version 1 hour

This commit is contained in:
mercury
2023-06-05 13:50:16 +04:00
parent a8054d3e68
commit bd6a9f011b
+4 -3
View File
@@ -551,9 +551,10 @@ class Bot
{
try {
require __DIR__ . '/config.php';
if (!empty($c['admin'])) {
$current = file_get_contents('/version');
$last = file_get_contents('https://raw.githubusercontent.com/mercurykd/vpnbot/master/version');
if (!empty($c['admin']) && (empty($this->time) || ((time() - $this->time) > 3600))) {
$this->time = time();
$current = file_get_contents('/version');
$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)));