aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2023-11-06 19:18:54 +0100
committerGuillermo Ramos2023-11-06 19:18:54 +0100
commit96a8028a257c2c8a27b91ec9233309a9c91294a3 (patch)
treef3bf7b4c6c551b4ba8a53ca10b9a68ce554ceacb
parent6a61e9bd333f58aeea401bf6958446e9878df30d (diff)
downloadtgutils-develop.tar.gz
tgsend: exit if empty stdindevelop
-rwxr-xr-xtgsend2
1 files changed, 1 insertions, 1 deletions
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;
}