:global GlobalFuncReady false;
# Git commit id & info, expected configuration version
-:global CommitId "main/314/b8ef8d13";
+:global CommitId "main/315/84d64b90";
:global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:10:03 01.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:15:02 01.05.2026.";
# The variables are received right here.
:global GlobalConfVersion 138;
:global CertificateAvailable;
:global IsFullyConnected;
:global LogPrint;
-
- #:if ([ $IsFullyConnected ] = false) do={
- # $LogPrint debug $0 ("System is not fully connected, not flushing.");
- # :return false;
- #}
+
+ :if ([ $IsFullyConnected ] = false) do={
+ $LogPrint debug $0 ("System is not fully connected, not flushing.");
+ :return false;
+ }
:if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
$LogPrint warning $0 ("Downloading required certificate failed.");
:return false;
/system/scheduler/remove [ find where name="_FlushTelegramQueue" ];
:set TelegramQueue;
}
-} do={:global ExitOnError; $ExitOnError $0 $Err}
-}
+} do={
+:global ExitOnError; $ExitOnError $0 $Err;
+} }
+
# get the chat id
:set GetTelegramChatId do={ :onerror Err {
:global TelegramTokenId;
-# :global CertificateAvailable;
+ :global CertificateAvailable;
:global LogPrint;
-# :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
-# $LogPrint warning $0 ("Downloading required certificate failed.");
-# :return false;
-# }
+ :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
+ $LogPrint warning $0 ("Downloading required certificate failed.");
+ :return false;
+ }
:local Data;
:onerror Err {
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
:if (($Message->"is_topic_message") = true) do={
$LogPrint info $0 ("The thread id is: " . ($Message->"message_thread_id"));
}
-} do={:global ExitOnError; $ExitOnError $0 $Err}
-}
+} do={
+:global ExitOnError; $ExitOnError $0 $Err;
+} }
+
# send notification via telegram - expects one array argument
:set ($NotificationFunctions->"telegram") do={
:local Notification $1;
> # https://rsc.eworm.de/doc/mod/notification-telegram.md
26a23
>
-30,34c27,32
-<
-< #:if ([ $IsFullyConnected ] = false) do={
-< # $LogPrint debug $0 ("System is not fully connected, not flushing.");
-< # :return false;
-< #}
----
->
-> :if ([ $IsFullyConnected ] = false) do={
-> $LogPrint debug $0 ("System is not fully connected, not flushing.");
-> :return false;
-> }
+34a32
>
41a40
>
>
58a59
>
-63,64c64,67
-< } do={:global ExitOnError; $ExitOnError $0 $Err}
-< }
+64c65
+< :global ExitOnError; $ExitOnError $0 $Err;
---
-> } do={
> :global ExitOnError; $ExitOnError $0 $Err;
-> } }
+69a71
>
-68c71,72
-< # :global CertificateAvailable;
----
->
-> :global CertificateAvailable;
-70,73c74,79
-< # :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
-< # $LogPrint warning $0 ("Downloading required certificate failed.");
-< # :return false;
-< # }
----
+71a74
>
-> :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
-> $LogPrint warning $0 ("Downloading required certificate failed.");
-> :return false;
-> }
+75a79
>
-82a89
+84a89
>
-84a92
+86a92
>
-88a97
+90a97
>
-94,95c103,106
-< } do={:global ExitOnError; $ExitOnError $0 $Err}
-< }
+97,98c104,105
+< :global ExitOnError; $ExitOnError $0 $Err;
+< } }
---
-> } do={
> :global ExitOnError; $ExitOnError $0 $Err;
> } }
+102a110
>
-98a110
->
-108a121
+112a121
>
-116a130
+120a130
>
-120a135
+124a135
>
-122a138
+126a138
>
-133c149,153
+137c149,153
< :if ($Mode = "body") do={:return ("```\n" . $Text . "\n```")}
---
>
> :return ("```\n" . $Text . "\n```");
> }
>
-135a156
+139a156
>
-142,143c163,171
+146,147c163,171
< :if ([ :len $TokenId ] = 0 || [ :len $ChatId ] = 0) do={:return false}
< :if ([ :typeof $TelegramMessageIDs ] = "nothing") do={:set TelegramMessageIDs ({})}
---
> :set TelegramMessageIDs ({});
> }
>
-154c182,184
+158c182,184
< } else={:set Text ($Text . [ $EscapeMD ($Notification->"message") "body" ])}
---
> } else={
> :set Text ($Text . [ $EscapeMD ($Notification->"message") "body" ]);
> }
-164a195
+168a195
>
-179c210,213
+183c210,213
< :if ([ :typeof $TelegramQueue ] = "nothing") do={:set TelegramQueue ({})}
---
>
> :if ([ :typeof $TelegramQueue ] = "nothing") do={
> :set TelegramQueue ({});
> }
-190a225
+194a225
>
-193a229
+197a229
>
-196a233
+200a233
>
-199a237
+203a237
>
-201,202c239,242
+205,206c239,242
< } do={:global ExitOnError; $ExitOnError $0 $Err}
< }
---
> :global ExitOnError; $ExitOnError $0 $Err;
> } }
>
-205a246
+209a246
>
-206a248
+210a248
>