v0.0.9 18/07/2021
Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: divkix <divkix@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: Programming Error <error@notavailable.live>
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
# Ultroid - UserBot
|
||||
# Copyright (C) 2021 TeamUltroid
|
||||
#
|
||||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
||||
# PLease read the GNU Affero General Public License in
|
||||
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
||||
|
||||
"""
|
||||
✘ Commands Available
|
||||
|
||||
@@ -41,17 +48,41 @@ async def usage_finder(event):
|
||||
try:
|
||||
opt = event.text.split(" ", maxsplit=1)[1]
|
||||
except IndexError:
|
||||
return await x.edit(get_full_usage())
|
||||
return await x.edit(simple_usage())
|
||||
|
||||
if opt == "redis":
|
||||
return await x.edit(redis_usage())
|
||||
elif opt == "heroku":
|
||||
is_hk, hk = heroku_usage()
|
||||
await x.edit(hk)
|
||||
elif opt == "full":
|
||||
await x.edit(get_full_usage())
|
||||
else:
|
||||
await eor(x, "`The what?`", time=5)
|
||||
|
||||
|
||||
def simple_usage():
|
||||
total, used, free = shutil.disk_usage(".")
|
||||
cpuUsage = psutil.cpu_percent()
|
||||
memory = psutil.virtual_memory().percent
|
||||
disk = psutil.disk_usage("/").percent
|
||||
upload = humanbytes(psutil.net_io_counters().bytes_sent)
|
||||
down = humanbytes(psutil.net_io_counters().bytes_recv)
|
||||
TOTAL = humanbytes(total)
|
||||
USED = humanbytes(used)
|
||||
FREE = humanbytes(free)
|
||||
return get_string("usage_simple").format(
|
||||
TOTAL,
|
||||
USED,
|
||||
FREE,
|
||||
upload,
|
||||
down,
|
||||
cpuUsage,
|
||||
memory,
|
||||
disk,
|
||||
)
|
||||
|
||||
|
||||
def heroku_usage():
|
||||
if HEROKU_API is None and HEROKU_APP_NAME is None:
|
||||
return False, "You do not use heroku, bruh!"
|
||||
|
||||
Reference in New Issue
Block a user