Improve variable assignments
This commit is contained in:
parent
da4b5aa24d
commit
d16ad8e70f
12
ubot.py
12
ubot.py
@ -17,7 +17,7 @@ async def edit(event):
|
|||||||
await event.edit(rpl)
|
await event.edit(rpl)
|
||||||
|
|
||||||
if '.shg' in msg:
|
if '.shg' in msg:
|
||||||
rpl = f"¯\_(ツ)_/¯"
|
rpl = "¯\_(ツ)_/¯"
|
||||||
msg = event.text.replace('.shg', rpl)
|
msg = event.text.replace('.shg', rpl)
|
||||||
await event.edit(msg)
|
await event.edit(msg)
|
||||||
|
|
||||||
@ -97,17 +97,17 @@ async def edit(event):
|
|||||||
user = os.environ['USER']
|
user = os.environ['USER']
|
||||||
out = os.popen(cmd).read()
|
out = os.popen(cmd).read()
|
||||||
|
|
||||||
rpl = '`' + user + '@' + host + ' $ ' + cmd + '`\n'
|
rpl = f'`{user}@{host}$ {cmd}`\n'
|
||||||
rpl += '`' + out + '`\n'
|
rpl += f'`{out}`\n'
|
||||||
await event.edit(rpl)
|
await event.edit(rpl)
|
||||||
|
|
||||||
if '.sys' in msg:
|
if '.sys' in msg:
|
||||||
mem = os.popen('free -m').readlines()[1].split()[2]
|
mem = os.popen('free -m').readlines()[1].split()[2]
|
||||||
disk = os.popen('df -h /').readlines()[1].split()[2]
|
disk = os.popen('df -h /').readlines()[1].split()[2]
|
||||||
|
|
||||||
rpl = '**System usage stats:**\n'
|
rpl = f'**System usage stats:**\n'
|
||||||
rpl += '**Memory:** ' + mem + 'M\n'
|
rpl += f'**Memory:** {mem}M\n'
|
||||||
rpl += '**Disk:** ' + disk + '\n'
|
rpl += f'**Disk:** {disk}\n'
|
||||||
await event.edit(rpl)
|
await event.edit(rpl)
|
||||||
|
|
||||||
if '.sauce' in msg:
|
if '.sauce' in msg:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user