From 96a8028a257c2c8a27b91ec9233309a9c91294a3 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Mon, 6 Nov 2023 19:18:54 +0100 Subject: tgsend: exit if empty stdin --- tgsend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tgsend') diff --git a/tgsend b/tgsend index 62aa347..c94df32 100755 --- a/tgsend +++ b/tgsend @@ -50,7 +50,7 @@ $text =~ s/^\s+|\s+$//g; # Trim input # Send message to chats (or pretend to) if ($PRETEND) { $logger->info("(prentend) Sending to $_: '$text'\n") foreach @ARGV; -} else { +} elsif (length $text > 0) { my $api = TgLib::Api->new($TOKEN, $logger); $api->send_message($_, $text) foreach @ARGV; } -- cgit v1.2.3