diff --git a/app/bot.php b/app/bot.php index e1e8768..8d1ab86 100644 --- a/app/bot.php +++ b/app/bot.php @@ -513,6 +513,10 @@ class Bot public function timerClient(string $time, int $client) { $clients = $this->readClients(); + if ($clients[$client]['# off']) { + $this->switchClient($client); + $clients = $this->readClients(); + } $server = $this->readConfig(); switch (true) { case preg_match('~^0$~', $time): @@ -571,7 +575,7 @@ class Bot public function getTime(int $seconds) { - $seconds = $seconds - time(); + $seconds = ($seconds - time()) > 0 ? $seconds - time() : 0; $items = [ 'Y' => [ 'diff' => 1970, @@ -786,7 +790,7 @@ class Bot public function switchClient($client) { $clients = $this->readClients(); - $server = $this->readConfig(); + $server = $this->readConfig(); if ($clients[$client]['# off']) { unset($clients[$client]['# off']); } else { diff --git a/version b/version index d55b1f3..3b496b6 100644 --- a/version +++ b/version @@ -1,3 +1,5 @@ +07.06.2023 установка таймера включает пир, если он был выключен +git pull 07.06.2023 адаптация конфига wg под текущий домен/айпи/порт git pull 06.06.2023 отображение времени жизни пира в виде счетчика