Updating .mcstatus to show correct colors.

This commit is contained in:
blha303 2013-04-04 22:35:34 +08:00
parent 6516caccdc
commit 5a64ce4983

View file

@ -73,12 +73,13 @@ def mcstatus(inp, say=None):
data = json.loads(request.replace("}", "").replace("{", "").replace("]", "}").replace("[", "{"))
out = []
out.append("\x039")
# use a loop so we don't have to update it if they add more servers
for server, status in data.items():
if status == "green":
out.append("{} is \x033\x02online\x02\x03".format(server))
out.append("{} is \x033\x02online\x02\x039".format(server))
else:
out.append("{} is \x034\x02offline\x02\x03".format(server))
out.append("{} is \x034\x02offline\x02\x039".format(server))
return ", ".join(out) + "."