Added Total Usage
This commit is contained in:
@ -56,10 +56,12 @@ def process_show_user(message):
|
|||||||
else:
|
else:
|
||||||
upload_gb = upload_bytes / (1024 ** 3) # Convert bytes to GB
|
upload_gb = upload_bytes / (1024 ** 3) # Convert bytes to GB
|
||||||
download_gb = download_bytes / (1024 ** 3) # Convert bytes to GB
|
download_gb = download_bytes / (1024 ** 3) # Convert bytes to GB
|
||||||
|
totalusage = upload_gb + download_gb
|
||||||
|
|
||||||
traffic_message = (
|
traffic_message = (
|
||||||
f"🔼 Upload: {upload_gb:.2f} GB\n"
|
f"🔼 Upload: {upload_gb:.2f} GB\n"
|
||||||
f"🔽 Download: {download_gb:.2f} GB\n"
|
f"🔽 Download: {download_gb:.2f} GB\n"
|
||||||
|
f"📊 Total Usage: {totalusage:.2f} GB\n"
|
||||||
f"🌐 Status: {status}"
|
f"🌐 Status: {status}"
|
||||||
)
|
)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
@ -208,4 +210,4 @@ def process_edit_expiration(message, username):
|
|||||||
result = run_cli_command(command)
|
result = run_cli_command(command)
|
||||||
bot.reply_to(message, result)
|
bot.reply_to(message, result)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
bot.reply_to(message, "Invalid expiration days. Please enter a number.")
|
bot.reply_to(message, "Invalid expiration days. Please enter a number.")
|
||||||
|
|||||||
Reference in New Issue
Block a user