diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-21 13:39:56 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-21 14:28:23 +0100 |
commit | cc81e556491c40d9b2a0d164eda16e196ac72aa6 (patch) | |
tree | 46ed445c35dba01db65b4c8cfb43a3726ff1bcc5 /telegram-chat.rsc | |
parent | 6628d9f9665cc224423c904ef65d84a25c8de817 (diff) |
telegram-chat: improve readability with symbols
Diffstat (limited to 'telegram-chat.rsc')
-rw-r--r-- | telegram-chat.rsc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/telegram-chat.rsc b/telegram-chat.rsc index c81b714..4245cfd 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -136,23 +136,26 @@ :execute script=(":do {\n" . $Message->"text" . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \ "/file/add name=\"" . $File . ".done\"") file=($File . "\00"); :if ([ $WaitForFile ($File . ".done") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={ - :set State "The command did not finish, still running in background.\n\n"; + :set State ([ $SymbolForNotification "warning-sign" ] . "The command did not finish, still running in background.\n\n"); } :if ([ :len [ /file/find where name=($File . ".failed") ] ] > 0) do={ - :set State "The command failed with an error!\n\n"; + :set State ([ $SymbolForNotification "cross-mark" ] . "The command failed with an error!\n\n"); } :local Content [ /file/get $File contents ]; $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; replyto=($Message->"message_id"); \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ - message=("Command:\n" . $Message->"text" . "\n\n" . $State . [ $IfThenElse ([ :len $Content ] > 0) \ - ("Output:\n" . $Content) [ $IfThenElse ([ /file/get $File size ] > 0) \ - ("Output exceeds file read size.") ("No output.") ] ]) }); + message=([ $SymbolForNotification "gear" ] . "Command:\n" . $Message->"text" . "\n\n" . \ + $State . [ $IfThenElse ([ :len $Content ] > 0) \ + ([ $SymbolForNotification "memo" ] . "Output:\n" . $Content) [ $IfThenElse ([ /file/get $File size ] > 0) \ + ([ $SymbolForNotification "warning-sign" ] . "Output exceeds file read size.") \ + ([ $SymbolForNotification "memo" ] . "No output.") ] ]) }); /file/remove "tmpfs/telegram-chat"; } else={ $LogPrint info $ScriptName ("The command from update " . $UpdateID . " failed syntax validation!"); $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=false; replyto=($Message->"message_id"); \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ - message=("Command:\n" . $Message->"text" . "\n\nThe command failed syntax validation!") }); + message=([ $SymbolForNotification "gear" ] . "Command:\n" . $Message->"text" . "\n\n" . \ + [ $SymbolForNotification "cross-mark" ] . "The command failed syntax validation!") }); } } } else={ |