Update Show User

This commit is contained in:
Whispering Wind
2024-08-06 21:46:08 +03:30
committed by GitHub
parent 42fc84c209
commit 02d91660c5

View File

@ -102,20 +102,13 @@ def process_show_user(message):
f"Blocked: {user_details['blocked']}" f"Blocked: {user_details['blocked']}"
) )
qr_command = f"bash /etc/hysteria/core/scripts/hysteria2/show_user_uri.sh {username}" qr_command = f"python3 {CLI_PATH} show-user-uri -u {username} -ip 4"
qr_result = run_cli_command(qr_command) qr_result = run_cli_command(qr_command)
if "Error" in qr_result or "Invalid" in qr_result: if "Error" in qr_result or "Invalid" in qr_result:
bot.reply_to(message, qr_result) bot.reply_to(message, qr_result)
return return
uri_v4 = qr_result.split('\n')[-1].strip()
uris = qr_result.split('\n')
if len(uris) < 2:
bot.reply_to(message, "Failed to retrieve URIs. Please check the username or try again later.")
return
uri_v4 = uris[0].strip()
uri_v6 = uris[1].strip()
qr_v4 = qrcode.make(uri_v4) qr_v4 = qrcode.make(uri_v4)
bio_v4 = io.BytesIO() bio_v4 = io.BytesIO()