From d834ae9070c03896a9519ea943ff29bb981170bd Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Fri, 28 Feb 2014 17:28:54 +1300 Subject: [PATCH] Finished new mcuser - added legacy status and pretty colors --- plugins/minecraft_user.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/minecraft_user.py b/plugins/minecraft_user.py index 95b9cf5..6bd9175 100644 --- a/plugins/minecraft_user.py +++ b/plugins/minecraft_user.py @@ -49,6 +49,8 @@ def get_profile(name): profile["name"] = user["name"] profile["id"] = user["id"] + profile["legacy"] = user.get("legacy", False) + try: response = http.get(PAID_URL, user=name) except (http.URLError, http.HTTPError) as e: @@ -82,11 +84,13 @@ def mcuser(inp): except McuError as e: return "Error: {}".format(e) + profile["lt"] = ", legacy" if profile["legacy"] else "" + if profile["paid"]: - return u"The account \x02{name}\x02 ({id}) exists and \x02is a paid\x02 minecraft" \ + return u"The account \x02{name}\x02 ({id}{lt}) exists. It is a \x033\x02paid\x02\x0f" \ u" account.".format(**profile) else: - return u"The account \x02{name}\x02 ({id}) exists, but \x02is NOT\x02 a paid minecraft" \ + return u"The account \x02{name}\x02 ({id}{lt}) exists. It \x034\x02is NOT\x02\x0f a paid" \ u" account.".format(**profile) elif name_status == "free": return u"The account \x02{}\x02 does not exist.".format(user)