Add .sys command
This commit is contained in:
parent
bb0c8ec452
commit
da4b5aa24d
9
ubot.py
9
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)'
|
||||
|
Loading…
x
Reference in New Issue
Block a user