mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-17 14:39:33 +00:00
telegram-chat: use :continue in loop
This commit is contained in:
parent
7c318e144f
commit
1de4bdb909
1 changed files with 4 additions and 5 deletions
|
|
@ -115,7 +115,6 @@
|
|||
}
|
||||
|
||||
:if ($Trusted = true) do={
|
||||
:local Done false;
|
||||
:if ($Command = "?") do={
|
||||
$LogPrint info $ScriptName ("Sending notice for update " . $UpdateID . ".");
|
||||
$SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; \
|
||||
|
|
@ -123,9 +122,9 @@
|
|||
subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
|
||||
message=([ $IfThenElse ([ :len ($From->"first_name") ] > 0) ("Hello " . ($From->"first_name") . "!\n\n") ] . \
|
||||
"Online" . [ $IfThenElse $TelegramChatActive " (and active!)" ] . ", awaiting your commands!") });
|
||||
:set Done true;
|
||||
:continue;
|
||||
}
|
||||
:if ($Done = false && [ :pick $Command 0 1 ] = "!") do={
|
||||
:if ([ :pick $Command 0 1 ] = "!") do={
|
||||
:if ($Command ~ ("^! *(" . [ $EscapeForRegEx $Identity ] . "|@" . $TelegramChatGroups . ")\$")) do={
|
||||
:set TelegramChatActive true;
|
||||
} else={
|
||||
|
|
@ -133,9 +132,9 @@
|
|||
}
|
||||
$LogPrint info $ScriptName ("Now " . [ $IfThenElse $TelegramChatActive "active" "passive" ] . \
|
||||
" from update " . $UpdateID . "!");
|
||||
:set Done true;
|
||||
:continue;
|
||||
}
|
||||
:if ($Done = false && ($IsMyReply = 1 || ($IsAnyReply = false && \
|
||||
:if (($IsMyReply = 1 || ($IsAnyReply = false && \
|
||||
$TelegramChatActive = true)) && [ :len $Command ] > 0) do={
|
||||
:if ([ $ValidateSyntax $Command ] = true) do={
|
||||
:local State "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue