diff --git a/README.md b/README.md index 87b0764..565bf1a 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ Telegram bot to download music from Deezer powered by [deethon](https://github.com/deethon) # deploy [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) +# credits +- [aykxt](https://github.com/aykxt) for deethon diff --git a/deegram/__main__.py b/deegram/__main__.py index 9b1194d..1a467a0 100644 --- a/deegram/__main__.py +++ b/deegram/__main__.py @@ -1,4 +1,4 @@ -import shutil +import shutil, psutil import time from telethon import Button, events @@ -47,7 +47,12 @@ async def stats(event: NewMessage.Event): total = get_readable_file_size(total) used = get_readable_file_size(used) free = get_readable_file_size(free) - await event.reply(translate.STATS_MSG.format(current_time, total, used, free)) + upload = get_readable_file_size(psutil.net_io_counters().bytes_sent) + download = get_readable_file_size(psutil.net_io_counters().bytes_recv) + cpu = psutil.cpu_percent(interval=0.5) + ram = psutil.virtual_memory().percent + disk = psutil.disk_usage('/').percent + await event.reply(translate.STATS_MSG.format(current_time, total, used, free, upload, download, cpu, ram, disk)) raise StopPropagation diff --git a/deegram/utils/translate.py b/deegram/utils/translate.py index bc5faf8..5e9ca5f 100644 --- a/deegram/utils/translate.py +++ b/deegram/utils/translate.py @@ -1,4 +1,4 @@ -VERSION = "0.2.1" +VERSION = "0.2.2" CREATOR = "@hafitzXD" BOT_NAME = "Deezfitz" WELCOME_MSG = ( @@ -10,13 +10,18 @@ f"ℹ Version: {VERSION}" ) STATS_MSG = ( - "Bot Uptime: {}\n" - "Total disk space: {}\n" - "Used: {}\n" - "Free: {}" + "**Bot Uptime:** {}\n" + "**Total disk space:** {}\n" + "**Used:** {} " + "**Free:** {}\n\n" + "📊Data Usage📊\n**Upload:** {}\n" + "**Download:** {}\n\n" + "**CPU:** {}\n" + "**RAM:** {}\n" + "**DISK:** {}" ) HELP_MSG = ( - "Search by album or track or just send me a Deezer track or album link and I will download it for you :)\n\n" + "Search by album or track or just send me a Deezer track or album link and I will download it for you 🙂\n\n" "**List of all commands:**\n" "/start - Get the welcome message\n" "/help - Get this message\n" diff --git a/requirements.txt b/requirements.txt index 8e6b3a8..94e6728 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ aiodns~=2.0.0 cchardet~=2.1.7 deethon~=0.5.1 uvloop~=0.15.2 +psutil