From d4dee5b6ccf6a18817eae6f0cb97356bb77c5413 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 22 Jan 2026 10:28:50 +0100 Subject: [PATCH 1/2] telegram-chat: use :break in loop --- telegram-chat.rsc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index cd790051..86114e0a 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -68,12 +68,12 @@ :local Data false; :for I from=1 to=4 do={ - :if ($Data = false) do={ :onerror Err { :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \ ("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \ $TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data"); :set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ]; + :break; } do={ :if ($I < 4) do={ $LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err); @@ -81,7 +81,6 @@ :delay (($I * $I) . "s"); } } - } } :if ($Data = false) do={ From 20bce0e969ee7cbb09c77712d79eff32da936a4d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 22 Jan 2026 10:29:31 +0100 Subject: [PATCH 2/2] telegram-chat: fix indention --- telegram-chat.rsc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 86114e0a..615008d5 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -68,19 +68,19 @@ :local Data false; :for I from=1 to=4 do={ - :onerror Err { - :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \ - ("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \ - $TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data"); - :set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ]; - :break; - } do={ - :if ($I < 4) do={ - $LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err); - :set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ]; - :delay (($I * $I) . "s"); - } + :onerror Err { + :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \ + ("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \ + $TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data"); + :set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ]; + :break; + } do={ + :if ($I < 4) do={ + $LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err); + :set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ]; + :delay (($I * $I) . "s"); } + } } :if ($Data = false) do={