diff options
author | Guillermo Ramos | 2019-06-25 02:22:00 +0200 |
---|---|---|
committer | Guillermo Ramos | 2019-06-25 02:22:00 +0200 |
commit | d7f4ee6f0f86f462c26a27eb8d267abd592f01af (patch) | |
tree | 4745a16ba2198b6f4d62f9b70344729948c86161 | |
parent | d27d603d01b025d1bb85e463601428736d01f273 (diff) | |
download | tgutils-d7f4ee6f0f86f462c26a27eb8d267abd592f01af.tar.gz |
Use same token for tgsend/tgrecv from tgserver
-rwxr-xr-x | tgserver | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 { |