From da4b5aa24da12dc600cec2b758bab02bf60bde91 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Mon, 22 Mar 2021 10:25:15 +0100 Subject: [PATCH] Add .sys command --- ubot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ubot.py b/ubot.py index b1f0782..0a33f88 100644 --- a/ubot.py +++ b/ubot.py @@ -100,6 +100,15 @@ async def edit(event): rpl = '`' + user + '@' + host + ' $ ' + cmd + '`\n' rpl += '`' + out + '`\n' await event.edit(rpl) + + if '.sys' in msg: + mem = os.popen('free -m').readlines()[1].split()[2] + disk = os.popen('df -h /').readlines()[1].split()[2] + + rpl = '**System usage stats:**\n' + rpl += '**Memory:** ' + mem + 'M\n' + rpl += '**Disk:** ' + disk + '\n' + await event.edit(rpl) if '.sauce' in msg: rpl = 'Sauce: [ghnou/ubot](https://git.ghnou.su/ghnou/ubot)'