diff options
author | Christian Hesse <mail@eworm.de> | 2023-11-22 21:20:44 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-11-22 21:20:44 +0100 |
commit | cae5f425a6c9d1f5797d85f6d4cd21867cc5cf8f (patch) | |
tree | 58e47d12c483d4b8eb377cdb9a2fb007941dd554 /telegram-chat.rsc | |
parent | d1abbede75253e3f10be0cba6e7ae68a1700865f (diff) |
telegram-chat: get rid of '.txt' file extension
Diffstat (limited to 'telegram-chat.rsc')
-rw-r--r-- | telegram-chat.rsc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 686becc..9515119 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -112,18 +112,18 @@ $WaitFullyConnected; $MkDir "tmpfs/telegram-chat"; $LogPrintExit2 info $0 ("Running command from update " . $UpdateID . ": " . $Message->"text") false; :execute script=(":do {\n" . $Message->"text" . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \ - "/file/add name=\"" . $File . ".done\"") file=$File; + "/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"; } :if ([ :len [ /file/find where name=($File . ".failed") ] ] > 0) do={ :set State "The command failed with an error!\n\n"; } - :local Content [ /file/get ($File . ".txt") contents ]; + :local Content [ /file/get $File contents ]; $SendTelegram2 ({ origin=$0; 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 . ".txt") size ] > 0) \ + ("Output:\n" . $Content) [ $IfThenElse ([ /file/get $File size ] > 0) \ ("Output exceeds file read size.") ("No output.") ] ]) }); /file/remove "tmpfs/telegram-chat"; } else={ |