telegram-chat: error when making directory fails

This commit is contained in:
Christian Hesse 2024-03-04 20:49:44 +01:00
parent ed790dea6e
commit 010bea56dc

View file

@ -126,7 +126,9 @@
:if ([ $ValidateSyntax ($Message->"text") ] = true) do={ :if ([ $ValidateSyntax ($Message->"text") ] = true) do={
:local State ""; :local State "";
:local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]); :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]);
$MkDir "tmpfs/telegram-chat"; :if ([ $MkDir "tmpfs/telegram-chat" ] = false) do={
$LogPrintExit2 error $ScriptName ("Failed creating directory!") true;
}
$LogPrintExit2 info $ScriptName ("Running command from update " . $UpdateID . ": " . $Message->"text") false; $LogPrintExit2 info $ScriptName ("Running command from update " . $UpdateID . ": " . $Message->"text") false;
:execute script=(":do {\n" . $Message->"text" . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \ :execute script=(":do {\n" . $Message->"text" . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \
"/file/add name=\"" . $File . ".done\"") file=($File . "\00"); "/file/add name=\"" . $File . ".done\"") file=($File . "\00");