diff --git a/plugins/ping.py b/plugins/ping.py index 9710fd7..67f76dd 100755 --- a/plugins/ping.py +++ b/plugins/ping.py @@ -10,9 +10,9 @@ ping_regex = re.compile(r"(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)") @hook.command def ping(inp, reply=None): ".ping [count] -- Pings [count] times." - + if os.name == "nt": - return "Sorry, this command is not supported on Windows systems." + return "Sorry, this command is not supported on Windows systems." args = inp.split(' ') host = args[0] diff --git a/plugins/system.py b/plugins/system.py index 05ec335..ce216b6 100755 --- a/plugins/system.py +++ b/plugins/system.py @@ -2,8 +2,8 @@ import os import re import time import string -import psutil import platform +import subprocess from util import hook def replace(text, wordDic): @@ -69,11 +69,8 @@ def mem(inp): @hook.command(autohelp=False) def up(inp): ".up -- Shows the bot's uptime." - proc = psutil.Process(os.getpid()) - up_time = proc.create_time - up_time = time.time() - up_time - up_time = time.localtime(up_time) - up_time = time.strftime("Uptime: \x02%M:%S\x02", up_time) + up_time = subprocess.check_output("ps -eo pid,etime | grep %s | awk '{print $2}'" % os.getpid(), shell=True) + up_time = "Uptime: " + up_time return up_time @hook.command("proc", autohelp=False)