We don't need multiple hooks, this thing has autosuggest/complete
This commit is contained in:
parent
3c67274d5d
commit
a69e7fa510
|
@ -22,10 +22,9 @@ def checkProc(checked_stats):
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
|
|
||||||
@hook.command("system", autohelp=False)
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def sys(inp):
|
def system(inp):
|
||||||
".sys -- Retrieves information about the host system."
|
".system -- Retrieves information about the host system."
|
||||||
name = platform.node()
|
name = platform.node()
|
||||||
os = platform.platform()
|
os = platform.platform()
|
||||||
python_version = platform.python_implementation() + ' ' + platform.python_version()
|
python_version = platform.python_implementation() + ' ' + platform.python_version()
|
||||||
|
@ -34,10 +33,9 @@ def sys(inp):
|
||||||
return 'Name: \x02%s\x02, Operating System: \x02%s\x02, Python Version: \x02%s\x02, Architecture: \x02%s\x02, CPU: \x02%s\x02' % (name, os, python_version, arch, cpu)
|
return 'Name: \x02%s\x02, Operating System: \x02%s\x02, Python Version: \x02%s\x02, Architecture: \x02%s\x02, CPU: \x02%s\x02' % (name, os, python_version, arch, cpu)
|
||||||
|
|
||||||
|
|
||||||
@hook.command("memory", autohelp=False)
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def mem(inp):
|
def memory(inp):
|
||||||
".mem -- Displays the bot's current memory usage."
|
".memory -- Displays the bot's current memory usage."
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
checked_stats = 'VmRSS VmSize VmPeak VmStk VmData'
|
checked_stats = 'VmRSS VmSize VmPeak VmStk VmData'
|
||||||
memory = checkProc(checked_stats)
|
memory = checkProc(checked_stats)
|
||||||
|
@ -65,15 +63,13 @@ def mem(inp):
|
||||||
return memory
|
return memory
|
||||||
|
|
||||||
|
|
||||||
@hook.command("uptime", autohelp=False)
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def up(inp):
|
def uptime(inp):
|
||||||
".up -- Shows the bot's uptime."
|
".uptime -- Shows the bot's uptime."
|
||||||
up_time = subprocess.check_output('ps -eo pid,etime | grep %s | awk \'{print $2}\'' % os.getpid(), shell=True)
|
up_time = subprocess.check_output('ps -eo pid,etime | grep %s | awk \'{print $2}\'' % os.getpid(), shell=True)
|
||||||
up_time = 'Uptime: \x02' + up_time + '\x02'
|
up_time = 'Uptime: \x02' + up_time + '\x02'
|
||||||
return up_time
|
return up_time
|
||||||
|
|
||||||
@hook.command("proc", autohelp=False)
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def pid(inp):
|
def pid(inp):
|
||||||
".pid -- Prints the bot's PID."
|
".pid -- Prints the bot's PID."
|
||||||
|
|
Reference in a new issue