diff --git a/install b/install index 953b3d2..c4197c9 100755 --- a/install +++ b/install @@ -13,8 +13,8 @@ mkconfig(){ [ $(id -u) = 0 ] && echo "Please do not run as root." && exit 1 [ ! -f ubot.py ] && echo "ubot.py not found, quitting." && exit 1 [ $0 != ./install ] && echo "Not launched from current directory." && exit 1 -[ ! -f config.py ] && mkconfig +[ ! -f config.py ] && mkconfig git pull pip3 install -U telethon --user diff --git a/ubot.py b/ubot.py index 63200a2..4773957 100755 --- a/ubot.py +++ b/ubot.py @@ -106,9 +106,14 @@ async def edit(event): await event.edit(rpl) if msg.startswith('.sys'): + import os from telethon import version from platform import python_version - mem = os.popen('free -m').readlines()[1].split()[2] + + mtot = open('/proc/meminfo').readlines()[0].split()[1] + mavl = open('/proc/meminfo').readlines()[2].split()[1] + mfree = (int(mtot) - int(mavl)) / 1024 + mem = round(mfree, 1) disk = os.popen('df -h /').readlines()[1].split()[2] rpl = f'**System usage stats:**\n'