telegram-chat: use :break in loop

This commit is contained in:
Christian Hesse 2026-01-22 10:28:50 +01:00
parent 71f59e12b1
commit d4dee5b6cc

View file

@ -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={