Update "qrPeer" function (#11)
This commit is contained in:
+7
-2
@@ -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']) {
|
||||
|
||||
Reference in New Issue
Block a user