Added used & free disk in status
Hello S M Mahabub Hossain AKA priiiyo, can u stop kangging this repo?
This commit is contained in:
parent
f1ea3ed64c
commit
d49ce11659
|
|
@ -67,10 +67,13 @@ def delete_all_messages():
|
|||
|
||||
|
||||
def update_all_messages():
|
||||
total, used, free = shutil.disk_usage('.')
|
||||
used = get_readable_file_size(used)
|
||||
free = get_readable_file_size(free)
|
||||
msg = get_readable_message()
|
||||
msg += f"<b>CPU:</b> {psutil.cpu_percent()}%\n" \
|
||||
f"<b>RAM:</b> {psutil.virtual_memory().percent}%\n" \
|
||||
f"<b>DISK:</b> {psutil.disk_usage('/').percent}%\n"
|
||||
msg += f"<b>CPU:</b> {psutil.cpu_percent()}%" \
|
||||
f" <b>RAM:</b> {psutil.virtual_memory().percent}%" \
|
||||
f" <b>DISK:</b> {psutil.disk_usage('/').percent}%"
|
||||
with download_dict_lock:
|
||||
dlspeed_bytes = 0
|
||||
uldl_bytes = 0
|
||||
|
|
@ -88,7 +91,7 @@ def update_all_messages():
|
|||
uldl_bytes += float(speedy.split('M')[0]) * 1048576
|
||||
dlspeed = get_readable_file_size(dlspeed_bytes)
|
||||
ulspeed = get_readable_file_size(uldl_bytes)
|
||||
msg += f"\n<b>DL:</b> {dlspeed}ps 🔻| <b>UL:</b> {ulspeed}ps 🔺\n"
|
||||
msg += f"\n<b>USED:</b> {used} | <b>FREE:</b> {free}\n<b>DL:</b> {dlspeed}ps 🔻 | <b>UL:</b> {ulspeed}ps 🔺\n"
|
||||
with status_reply_dict_lock:
|
||||
for chat_id in list(status_reply_dict.keys()):
|
||||
if status_reply_dict[chat_id] and msg != status_reply_dict[chat_id].text:
|
||||
|
|
@ -102,10 +105,13 @@ def update_all_messages():
|
|||
|
||||
|
||||
def sendStatusMessage(msg, bot):
|
||||
total, used, free = shutil.disk_usage('.')
|
||||
used = get_readable_file_size(used)
|
||||
free = get_readable_file_size(free)
|
||||
progress = get_readable_message()
|
||||
progress += f"<b>CPU:</b> {psutil.cpu_percent()}%\n" \
|
||||
f"<b>RAM:</b> {psutil.virtual_memory().percent}%\n" \
|
||||
f"<b>DISK:</b> {psutil.disk_usage('/').percent}%\n"
|
||||
progress += f"<b>CPU:</b> {psutil.cpu_percent()}%" \
|
||||
f" <b>RAM:</b> {psutil.virtual_memory().percent}%" \
|
||||
f" <b>DISK:</b> {psutil.disk_usage('/').percent}%"
|
||||
with download_dict_lock:
|
||||
dlspeed_bytes = 0
|
||||
uldl_bytes = 0
|
||||
|
|
@ -123,7 +129,7 @@ def sendStatusMessage(msg, bot):
|
|||
uldl_bytes += float(speedy.split('M')[0]) * 1048576
|
||||
dlspeed = get_readable_file_size(dlspeed_bytes)
|
||||
ulspeed = get_readable_file_size(uldl_bytes)
|
||||
progress += f"\n<b>DL: </b>{dlspeed}ps 🔻| <b>UL: </b>{ulspeed}ps 🔺\n"
|
||||
progress += f"\n<b>USED:</b> {used} | <b>FREE:</b> {free}\n<b>DL:</b> {dlspeed}ps 🔻 | <b>UL:</b> {ulspeed}ps 🔺\n"
|
||||
with status_reply_dict_lock:
|
||||
if msg.message.chat.id in list(status_reply_dict.keys()):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in New Issue