From 49cefc32313120eb3d0056c009a9f20fa6ef5ec7 Mon Sep 17 00:00:00 2001 From: Bkeenke <128972800+bkeenke@users.noreply.github.com> Date: Sun, 21 Apr 2024 11:06:32 +0300 Subject: [PATCH] Update "qrPeer" function (#11) --- app/bot.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/bot.php b/app/bot.php index 9c38995..acaf834 100644 --- a/app/bot.php +++ b/app/bot.php @@ -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']) {