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

telegram-chat: modify text if no output available

This commit is contained in:
Christian Hesse
2023-02-01 14:25:13 +01:00
parent b5399099c6
commit 8dd53c80f5

View File

@ -111,7 +111,8 @@ $WaitFullyConnected;
:local Content [ /file/get ($File . ".txt") content ]; :local Content [ /file/get ($File . ".txt") content ];
$SendTelegram2 ({ origin=$0; silent=false; \ $SendTelegram2 ({ origin=$0; silent=false; \
subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
message=("Command:\n" . $Text . "\n\n" . $State . "Output:\n" . $Content) }); message=("Command:\n" . $Text . "\n\n" . $State . [ $IfThenElse ([ :len $Content ] > 0) \
("Output:\n" . $Content) "No output available." ]) });
/file/remove "tmpfs/telegram-chat"; /file/remove "tmpfs/telegram-chat";
} else={ } else={
$SendTelegram2 ({ origin=$0; silent=false; \ $SendTelegram2 ({ origin=$0; silent=false; \