Add .sys command

This commit is contained in:
Michael De Roover 2021-03-22 10:25:15 +01:00
parent bb0c8ec452
commit da4b5aa24d
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -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)'