From 26b299bcb96d8ac0f7743a1b5dd47444fd196ad6 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:38:19 +0330 Subject: [PATCH] Added Total Usage --- core/scripts/telegrambot/utils/edituser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/scripts/telegrambot/utils/edituser.py b/core/scripts/telegrambot/utils/edituser.py index 923cfcd..db5c61d 100644 --- a/core/scripts/telegrambot/utils/edituser.py +++ b/core/scripts/telegrambot/utils/edituser.py @@ -56,10 +56,12 @@ def process_show_user(message): else: upload_gb = upload_bytes / (1024 ** 3) # Convert bytes to GB download_gb = download_bytes / (1024 ** 3) # Convert bytes to GB + totalusage = upload_gb + download_gb traffic_message = ( f"🔼 Upload: {upload_gb:.2f} GB\n" f"🔽 Download: {download_gb:.2f} GB\n" + f"📊 Total Usage: {totalusage:.2f} GB\n" f"🌐 Status: {status}" ) except json.JSONDecodeError: @@ -208,4 +210,4 @@ def process_edit_expiration(message, username): result = run_cli_command(command) bot.reply_to(message, result) except ValueError: - bot.reply_to(message, "Invalid expiration days. Please enter a number.") \ No newline at end of file + bot.reply_to(message, "Invalid expiration days. Please enter a number.")