From c6306aa918c9e0d0a064e641eb4cad29faa7fcd6 Mon Sep 17 00:00:00 2001 From: mercury Date: Sat, 17 May 2025 13:52:45 +0400 Subject: [PATCH] vless: check already exists user --- app/bot.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/bot.php b/app/bot.php index 0125138..d2d5d76 100644 --- a/app/bot.php +++ b/app/bot.php @@ -5345,8 +5345,16 @@ DNS-over-HTTPS with IP: $p = $this->getPacConf(); $users = array_map(fn ($e) => trim($e), explode(',', $users)); $users = array_map(fn ($e) => explode(':', $e), $users); + foreach ($c['inbounds'][0]['settings']['clients'] as $k => $v) { + $uuids[] = $v['id']; + $emails[] = $v['email']; + } foreach ($users as $user) { $uuid = $user[1] ?: trim($this->ssh('xray uuid', 'xr')); + if (in_array($uuid, $uuids ?: []) || in_array($user[0], $emails ?: [])) { + $this->send($this->input['chat'], "user {$user[0]} already exists"); + return $this->xray(); + } $c['inbounds'][0]['settings']['clients'][] = $p['transport'] != 'Reality' ? [ 'id' => $uuid, 'email' => $user[0],