:global GlobalFuncReady false;
# Git commit id & info, expected configuration version
-:global CommitId "main/323/5941eae8";
+:global CommitId "main/324/d193fd99";
:global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:55:02 01.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:00:02 01.05.2026.";
# The variables are received right here.
:global GlobalConfVersion 138;
:if ([ :len [ /system/scheduler/find where name=$ScriptName ] ] = 0) do={
/system/scheduler/add start-time=startup interval=30s name=$ScriptName on-event="/system/script/run $ScriptName;" comment="Telegram Chat Bot";
}
-
:if ([ :typeof $TelegramChatOffset ] != "array") do={
:set TelegramChatOffset { 0; 0; 0 };
}
}
$RandomDelay $TelegramRandomDelay;
+
:local Data false;
:for I from=1 to=4 do={
:if ($Data = false) do={
}
}
}
+
:if ($Data = false) do={
$LogPrint warning $ScriptName ("Failed getting updates.");
:set ExitOK true;
:local From ($Message->"from");
:local Command ($Message->"text");
:local ThreadId [ $IfThenElse ($Message->"is_topic_message") ($Message->"message_thread_id") "" ];
+
:foreach IdsTrusted in=($TelegramChatId, $TelegramChatIdsTrusted) do={
:if ($From->"id" = $IdsTrusted || \
$From->"username" = $IdsTrusted || \
:set Trusted true;
}
}
+
:if ($Trusted = true) do={
:local Done false;
:if ($Command = "?") do={
replyto=($Message->"message_id"); threadid=$ThreadId; \
subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
message=("You are not trusted.") });
- } else={$LogPrint info $ScriptName $MessageText}
+ } else={
+ $LogPrint info $ScriptName $MessageText;
+ }
}
} else={
$LogPrint debug $ScriptName ("Already handled update " . $UpdateID . ".");
---
> :global GlobalConfigReady; :global GlobalFunctionsReady;
> :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
-54,57d56
+54,56d56
< :if ([ :len [ /system/scheduler/find where name=$ScriptName ] ] = 0) do={
< /system/scheduler/add start-time=startup interval=30s name=$ScriptName on-event="/system/script/run $ScriptName;" comment="Telegram Chat Bot";
< }
-<
-71a71
+111a112
>
-88a89
+118a120
>
-110a112
->
-117a120
->
-186c189,191
-< } else={$LogPrint info $ScriptName $MessageText}
----
-> } else={
-> $LogPrint info $ScriptName $MessageText;
-> }