mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 09:44:30 +02:00
telegram-chat: make $IsReply a boolean...
... and check for correct data type. We need this for a group with topic feature enabled, as that variable is set there, but is is an array.
This commit is contained in:
parent
a22b62f588
commit
757fa60e6f
1 changed files with 3 additions and 2 deletions
|
@ -97,7 +97,7 @@
|
|||
:foreach Update in=($JSON->"result") do={
|
||||
:set UpdateID ($Update->"update_id");
|
||||
:local Message ($Update->"message");
|
||||
:local IsReply [ :len ($Message->"reply_to_message") ];
|
||||
:local IsReply ([ :typeof ($Message->"reply_to_message") ] = "string");
|
||||
:local IsMyReply ($TelegramMessageIDs->[ :tostr ($Message->"reply_to_message"->"message_id") ]);
|
||||
:if (($IsMyReply = 1 || $TelegramChatOffset->0 > 0 || $Uptime > 5m) && $UpdateID >= $TelegramChatOffset->2) do={
|
||||
:local Trusted false;
|
||||
|
@ -130,7 +130,8 @@
|
|||
" from update " . $UpdateID . "!");
|
||||
:set Done true;
|
||||
}
|
||||
:if ($Done = false && ($IsMyReply = 1 || ($IsReply = 0 && $TelegramChatActive = true)) && [ :len $Command ] > 0) do={
|
||||
:if ($Done = false && ($IsMyReply = 1 || ($IsReply = false && \
|
||||
$TelegramChatActive = true)) && [ :len $Command ] > 0) do={
|
||||
:if ([ $ValidateSyntax $Command ] = true) do={
|
||||
:local State "";
|
||||
:local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue