Update "qrPeer" function (#11)

This commit is contained in:
Bkeenke
2024-04-21 11:06:32 +03:00
committed by GitHub
parent b227431b7a
commit 49cefc3231
+7 -2
View File
@@ -1477,14 +1477,19 @@ class Bot
$cl = $client;
$client = $this->readClients()[$client];
$name = $this->getName($client['interface']);
$code = $this->createConfig($client);
if ($this->getWGType() == 'awg') {
$sl = $this->getAmneziaShortLink($client);
$code = preg_replace('/^vpn:\/\//', '', $sl);
} else {
$code = $this->createConfig($client);
}
$qr = preg_replace(['~\s+~', '~\(~', '~\)~'], ['_'], $name);
$qr_file = __DIR__ . "/qr/$qr.png";
exec("qrencode -t png -o $qr_file '$code'");
$r = $this->sendPhoto(
$this->input['chat'],
curl_file_create($qr_file),
$name,
($this->getWGType() == 'awg') ? "$name for AmneziaVPN" : $name
);
unlink($qr_file);
if ($this->getPacConf()['blinkmenu']) {