mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-20 17:15:48 +02:00
telegram-chat: :do ... on-error=... -> :onerror ... do=...
This commit is contained in:
parent
d0adf9974e
commit
f22d46da96
1 changed files with 3 additions and 3 deletions
|
@ -70,14 +70,14 @@
|
|||
:local Data false;
|
||||
:for I from=1 to=4 do={
|
||||
:if ($Data = false) do={
|
||||
: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) ];
|
||||
} on-error={
|
||||
} do={
|
||||
:if ($I < 4) do={
|
||||
$LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try.");
|
||||
$LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
|
||||
:set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ];
|
||||
:delay (($I * $I) . "s");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue