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

View file

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