mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-29 20:54:28 +02:00
telegram-chat: log warning only when trying to activate
This commit is contained in:
parent
9d1cf87489
commit
4bc5b9cf5f
1 changed files with 5 additions and 2 deletions
|
@ -125,13 +125,16 @@ $WaitFullyConnected;
|
|||
}
|
||||
}
|
||||
} else={
|
||||
$LogPrintExit2 warning $0 ("Received a message from untrusted contact " . \
|
||||
:local Message ("Received a message from untrusted contact " . \
|
||||
[ $IfThenElse ($FromUserName = false) "without username" ("'" . $FromUserName . "'") ] . \
|
||||
" (ID " . $FromID . ")!") false;
|
||||
" (ID " . $FromID . ")!");
|
||||
:if ($Text ~ ("^! *" . [ $EscapeForRegEx $Identity ] . "\$")) do={
|
||||
$LogPrintExit2 warning $0 $Message false;
|
||||
$SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \
|
||||
subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
|
||||
message=("You are not trusted.") });
|
||||
} else={
|
||||
$LogPrintExit2 info $0 $Message false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue