h2/plugins/xeserv.py

22 lines
464 B
Python
Raw Normal View History

2015-11-29 06:42:25 +00:00
from util import hook
import requests
@hook.command
def minecraft(pls):
r = requests.get("http://xeserv.us/api/minecraft.json")
data = r.json()
if not data["online"]:
return "fluttershy.yochat.biz is down, oh noes"
if data["players"] == None:
return "fluttershy.yochat.biz has no online players"
return "fluttershy.yochat.biz has the following players: " + " ".join(data["players"])
@hook.command
def tf2(pls):
pass