This commit is contained in:
Luke Rogers 2014-02-28 15:52:05 +13:00
parent 1be204236a
commit 0acb22e0a7
2 changed files with 18 additions and 10 deletions

View File

@ -18,19 +18,27 @@ def mcstatus(inp):
out = []
# use a loop so we don't have to update it if they add more servers
yes = []
no = []
green = []
yellow = []
red = []
for server, status in data.items():
if status == "green":
yes.append(server)
green.append(server)
elif status == "yellow":
yellow.append(server)
else:
no.append(server)
if yes:
out = "\x033\x02Online\x02\x0f: " + ", ".join(yes)
if no:
red.append(server)
if green:
out = "\x033\x02Online\x02\x0f: " + ", ".join(green)
if yellow:
out += " "
if no:
out += "\x034\x02Offline\x02\x0f: " + ", ".join(no)
if yellow:
out += "\x02Issues\x02: " + ", ".join(yellow)
if red:
out += " "
if red:
out += "\x034\x02Offline\x02\x0f: " + ", ".join(red)
return "\x0f" + out.replace(".mojang.com", ".mj") \
.replace(".minecraft.net", ".mc")

View File

@ -39,7 +39,7 @@ def is_paid(name):
@hook.command("haspaid")
@hook.command("mcstatus")
@hook.command("mcpaid")
@hook.command
def mcuser(inp):
"""mcpaid <username> -- Gets information about the Minecraft user <account>."""