aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2019-06-25 02:22:00 +0200
committerGuillermo Ramos2019-06-25 02:22:00 +0200
commitd7f4ee6f0f86f462c26a27eb8d267abd592f01af (patch)
tree4745a16ba2198b6f4d62f9b70344729948c86161
parentd27d603d01b025d1bb85e463601428736d01f273 (diff)
downloadtgutils-d7f4ee6f0f86f462c26a27eb8d267abd592f01af.tar.gz
Use same token for tgsend/tgrecv from tgserver
-rwxr-xr-xtgserver4
1 files changed, 2 insertions, 2 deletions
diff --git a/tgserver b/tgserver
index 91283ba..ed58e46 100755
--- a/tgserver
+++ b/tgserver
@@ -36,7 +36,7 @@ $TOKEN ||= fetch_token() or
-verbose => 99, -sections => "AUTHENTICATION");
while (1) {
- open(my $recv, "-|", "$FindBin::Bin/tgrecv --auto-offset --timeout 100000");
+ open(my $recv, "-|", "$FindBin::Bin/tgrecv --token $TOKEN --auto-offset --timeout 100000");
foreach my $update (@{decode_json <$recv>}) {
$logger->debug(sprintf "Update %s", Dumper($update));
my $text = $update->{'message'}{'text'};
@@ -53,7 +53,7 @@ while (1) {
close($progr);
if ($response) {
- open(my $send, "|-", "$FindBin::Bin/tgsend $chatid");
+ open(my $send, "|-", "$FindBin::Bin/tgsend --token $TOKEN $chatid");
print $send $response;
close($send);
} else {