Rewrote mcpaid!

This commit is contained in:
Luke Rogers 2014-02-28 15:29:40 +13:00
parent 1bcf687ea2
commit a7a6f8c01e
2 changed files with 69 additions and 18 deletions

View file

@ -34,21 +34,3 @@ def mcstatus(inp):
return "\x0f" + out.replace(".mojang.com", ".mj") \
.replace(".minecraft.net", ".mc")
@hook.command("haspaid")
@hook.command
def mcpaid(inp):
"""mcpaid <username> -- Checks if <username> has a premium Minecraft account."""
user = inp.strip()
try:
status = http.get("http://www.minecraft.net/haspaid.jsp", user=user)
except (http.URLError, http.HTTPError) as e:
return "Unable to get user registration status: {}".format(e)
if "true" in status:
return 'The account "{}" is a premium Minecraft account!'.format(inp)
else:
return 'The account "{}" is not a premium Minecraft account!'.format(inp)