diff --git a/plugins/minecraft_status.py b/plugins/minecraft_status.py index 1a07b9f..0d7c8cf 100755 --- a/plugins/minecraft_status.py +++ b/plugins/minecraft_status.py @@ -3,7 +3,7 @@ import json @hook.command(autohelp=False) -def mcstatus(inp, say=None): +def mcstatus(inp): """mcstatus -- Checks the status of various Mojang (the creators of Minecraft) servers.""" try: @@ -16,13 +16,18 @@ def mcstatus(inp, say=None): out = [] # use a loop so we don't have to update it if they add more servers + yes = [] + no = [] for server, status in data.items(): if status == "green": - out.append("{} is \x033\x02online\x02\x0f".format(server)) + yes.append(server) else: - out.append("{} is \x034\x02offline\x02\x0f".format(server)) - - return "\x0f" + ", ".join(out) + "." + no.append(server) + if yes: + out = "\x033\x02Online\x02\x0f: " + ", ".join(yes) + if no: + out += "\x034\x02Offline\x02\x0f: " + ", ".join(no) + return "\x0f" + out.replace(".mojang.com", ".mj").replace(".minecraft.net", ".mc") @hook.command("haspaid")