|
|
|
@@ -244,8 +244,7 @@ class Bot
|
|
|
|
|
$this->addLinkDomain();
|
|
|
|
|
break;
|
|
|
|
|
case preg_match('~^/id$~', $this->input['message'], $m):
|
|
|
|
|
$this->send($this->input['chat'], $this->input['from'], $this->input['message_id']);
|
|
|
|
|
$this->send($this->input['chat'], $this->input['chat'], $this->input['message_id']);
|
|
|
|
|
$this->send($this->input['chat'], "your id: {$this->input['from']}\nchat id: {$this->input['chat']}", $this->input['message_id']);
|
|
|
|
|
break;
|
|
|
|
|
case preg_match('~^/adguardChBr$~', $this->input['callback'], $m):
|
|
|
|
|
$this->adguardChBr();
|
|
|
|
@@ -5885,9 +5884,10 @@ DNS-over-HTTPS with IP:
|
|
|
|
|
$st = $this->getXrayStats();
|
|
|
|
|
$td = $this->getBytes($st['global']['download'] + $st['session']['download']);
|
|
|
|
|
$tu = $this->getBytes($st['global']['upload'] + $st['session']['upload']);
|
|
|
|
|
$text[] = "↓$td ↑$tu";
|
|
|
|
|
$data[] = [
|
|
|
|
|
[
|
|
|
|
|
'text' => $this->i18n('reset stats') . ": ↓$td ↑$tu",
|
|
|
|
|
'text' => $this->i18n('reset stats'),
|
|
|
|
|
'callback_data' => '/resetXrStats',
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
@@ -6316,6 +6316,9 @@ DNS-over-HTTPS with IP:
|
|
|
|
|
$hash = $this->getHashBot();
|
|
|
|
|
|
|
|
|
|
$text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['email']}\n";
|
|
|
|
|
if (file_exists(__DIR__ . '/subscription.php')) {
|
|
|
|
|
$text[] = "<a href='$scheme://{$domain}/pac$hash/sub?id={$c['id']}'>subscription</a>";
|
|
|
|
|
}
|
|
|
|
|
$text[] = "<pre><code>{$this->linkXray($i)}</code></pre>\n";
|
|
|
|
|
|
|
|
|
|
$text[] = "<a href='$scheme://{$domain}/pac$hash?t=s&r=v&s={$c['id']}#{$c['email']}'>import://v2rayng</a>";
|
|
|
|
@@ -6443,6 +6446,47 @@ DNS-over-HTTPS with IP:
|
|
|
|
|
return $c['domain'] ?: $this->ip;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function sub()
|
|
|
|
|
{
|
|
|
|
|
$xr = $this->getXray();
|
|
|
|
|
$pac = $this->getPacConf();
|
|
|
|
|
$st = $this->getXrayStats();
|
|
|
|
|
$domain = $_GET['cdn'] ?: ($_SERVER['SERVER_NAME'] ?: $this->getDomain($pac['transport'] != 'Reality'));
|
|
|
|
|
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
|
|
|
|
|
$hash = $this->getHashBot();
|
|
|
|
|
$flag = true;
|
|
|
|
|
foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) {
|
|
|
|
|
if ($v['id'] == $_GET['id']) {
|
|
|
|
|
if (empty($v['off'])) {
|
|
|
|
|
$flag = false;
|
|
|
|
|
}
|
|
|
|
|
$uid = $v['id'];
|
|
|
|
|
$email = $v['email'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$download = $this->getBytes($st['users'][$k]['global']['download'] + $st['users'][$k]['session']['download']);
|
|
|
|
|
$upload = $this->getBytes($st['users'][$k]['global']['upload'] + $st['users'][$k]['session']['upload']);
|
|
|
|
|
$singbox = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
|
|
|
|
|
'h' => $hash,
|
|
|
|
|
't' => 'si',
|
|
|
|
|
's' => $uid,
|
|
|
|
|
]));
|
|
|
|
|
$xray = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
|
|
|
|
|
'h' => $hash,
|
|
|
|
|
't' => 's',
|
|
|
|
|
's' => $uid,
|
|
|
|
|
]));
|
|
|
|
|
$clash = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
|
|
|
|
|
'h' => $hash,
|
|
|
|
|
't' => 'cl',
|
|
|
|
|
's' => $uid,
|
|
|
|
|
]));
|
|
|
|
|
$vless = $this->linkXray($k);
|
|
|
|
|
$windows = "$scheme://{$domain}/pac$hash?t=si&r=w&s=$uid";
|
|
|
|
|
require __DIR__ . '/subscription.php';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function subscription()
|
|
|
|
|
{
|
|
|
|
|
switch ($_GET['t']) {
|
|
|
|
|