]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:00:02 01.05.2026.
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Thu, 30 Apr 2026 22:00:03 +0000 (01:00 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Thu, 30 Apr 2026 22:00:03 +0000 (01:00 +0300)
html/AM-GlobalFunc.rsc
html/mod/AM-TG-Bot.rsc
html/mod/AM-TG-Bot.rsc.diff

index ab53a4ccab42d4973a900e508d66cc134acdc3b3..6ea8f0a5d7c89d4150ee29851479f60805cda3fc 100644 (file)
@@ -17,9 +17,9 @@
 :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;
index ebc741627bdbb531b8d8a9b1b7ad797295ca5982..63089998b6e51e0abed8897564d33e120fc52f88 100644 (file)
@@ -54,7 +54,6 @@
   :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 };
   }
@@ -69,6 +68,7 @@
   }
 
   $RandomDelay $TelegramRandomDelay;
+
   :local Data false;
   :for I from=1 to=4 do={
     :if ($Data = false) do={
@@ -86,6 +86,7 @@
       }
     }
   }
+
   :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 . ".");
index 29730d9822569ecf1858f24b2205f104e37ff898..0c6a8857c93d7166d07232219908b68f82e45967 100644 (file)
 ---
 >   :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;
->         }