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)
|
||||
|
||||
if '.shg' in msg:
|
||||
rpl = f"¯\_(ツ)_/¯"
|
||||
rpl = "¯\_(ツ)_/¯"
|
||||
msg = event.text.replace('.shg', rpl)
|
||||
await event.edit(msg)
|
||||
|
||||
@ -97,17 +97,17 @@ async def edit(event):
|
||||
user = os.environ['USER']
|
||||
out = os.popen(cmd).read()
|
||||
|
||||
rpl = '`' + user + '@' + host + ' $ ' + cmd + '`\n'
|
||||
rpl += '`' + out + '`\n'
|
||||
rpl = f'`{user}@{host}$ {cmd}`\n'
|
||||
rpl += f'`{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'
|
||||
rpl = f'**System usage stats:**\n'
|
||||
rpl += f'**Memory:** {mem}M\n'
|
||||
rpl += f'**Disk:** {disk}\n'
|
||||
await event.edit(rpl)
|
||||
|
||||
if '.sauce' in msg:
|
||||
|
Loading…
x
Reference in New Issue
Block a user