From 9c066599e8a57bfcf26eacb18fcca8f404938f15 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 4 Feb 2023 23:24:44 +0100 Subject: telegram-chat: handle exceeded file read size --- telegram-chat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telegram-chat b/telegram-chat index 4c6ea21..c6a4c3b 100644 --- a/telegram-chat +++ b/telegram-chat @@ -115,7 +115,8 @@ $WaitFullyConnected; $SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=("Command:\n" . $Text . "\n\n" . $State . [ $IfThenElse ([ :len $Content ] > 0) \ - ("Output:\n" . $Content) "No output available." ]) }); + ("Output:\n" . $Content) [ $IfThenElse ([ /file/get ($File . ".txt") size ] > 0) \ + ("Output exceeds file read size.") ("No output.") ] ]) }); /file/remove "tmpfs/telegram-chat"; } else={ $SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \ -- cgit v1.2.3-54-g00ecf