mcstatus now checks the minecraft skin servers
This commit is contained in:
parent
50e575752d
commit
394a07235d
1 changed files with 8 additions and 2 deletions
|
@ -54,6 +54,13 @@ def mcstatus(inp, say=None):
|
||||||
# change the json from a list of dictionaies to a dictionary
|
# change the json from a list of dictionaies to a dictionary
|
||||||
data = json.loads(request.replace("}", "").replace("{", "").replace("]", "}").replace("[", "{"))
|
data = json.loads(request.replace("}", "").replace("{", "").replace("]", "}").replace("[", "{"))
|
||||||
|
|
||||||
|
# check if skins are online
|
||||||
|
try:
|
||||||
|
request = http.get("http://s3.amazonaws.com/MinecraftSkins/Shnaw.png")
|
||||||
|
data["minecraft skin server"] = "green"
|
||||||
|
except (http.URLError, http.HTTPError) as e:
|
||||||
|
data["minecraft skin server"] = "red"
|
||||||
|
|
||||||
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
|
||||||
for server, status in data.items():
|
for server, status in data.items():
|
||||||
|
@ -68,8 +75,7 @@ def mcstatus(inp, say=None):
|
||||||
@hook.command("haspaid")
|
@hook.command("haspaid")
|
||||||
@hook.command
|
@hook.command
|
||||||
def mcpaid(inp):
|
def mcpaid(inp):
|
||||||
"mcpaid <username> -- Checks if <username> has a" \
|
"mcpaid <username> -- Checks if <username> has a premium Minecraft account."
|
||||||
" premium Minecraft account."
|
|
||||||
login = http.get("http://www.minecraft.net/haspaid.jsp", user=inp)
|
login = http.get("http://www.minecraft.net/haspaid.jsp", user=inp)
|
||||||
|
|
||||||
if "true" in login:
|
if "true" in login:
|
||||||
|
|
Reference in a new issue