telegram-chat: use $FileExists ...

... to work around restrictions in new file handling.
This commit is contained in:
Christian Hesse 2025-05-30 22:41:03 +02:00
parent 80aed200fd
commit 30b80e903d

View file

@ -30,6 +30,7 @@
:global CertificateAvailable; :global CertificateAvailable;
:global EitherOr; :global EitherOr;
:global EscapeForRegEx; :global EscapeForRegEx;
:global FileExists;
:global GetRandom20CharAlNum; :global GetRandom20CharAlNum;
:global IfThenElse; :global IfThenElse;
:global LogPrint; :global LogPrint;
@ -154,7 +155,7 @@
:if ([ $WaitForFile ($File . ".done") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={ :if ([ $WaitForFile ($File . ".done") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={
:set State ([ $SymbolForNotification "warning-sign" ] . "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={ :if ([ $FileExists ($File . ".failed") ] = true) do={
:set State ([ $SymbolForNotification "cross-mark" ] . "The command failed with an error!\n\n"); :set State ([ $SymbolForNotification "cross-mark" ] . "The command failed with an error!\n\n");
} }
:local Content ([ /file/read chunk-size=32768 file=$File as-value ]->"data"); :local Content ([ /file/read chunk-size=32768 file=$File as-value ]->"data");