Added Total Usage

This commit is contained in:
Whispering Wind
2024-12-17 18:38:19 +03:30
committed by GitHub
parent 97f8824eac
commit 26b299bcb9

View File

@ -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.")
bot.reply_to(message, "Invalid expiration days. Please enter a number.")