1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

telegram-chat: log warning only when trying to activate

This commit is contained in:
Christian Hesse
2023-02-03 09:56:30 +01:00
parent 9d1cf87489
commit 4bc5b9cf5f

View File

@@ -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;
}
}
}