From 739165cac24ab6c813e28e16bd390438a59f78f7 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Mon, 2 Nov 2015 17:28:49 -0800 Subject: [PATCH] start xeserv.us plugin --- plugins/xeserv.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/xeserv.py diff --git a/plugins/xeserv.py b/plugins/xeserv.py new file mode 100644 index 0000000..66977de --- /dev/null +++ b/plugins/xeserv.py @@ -0,0 +1,21 @@ +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: " + (reduce (lambda x, y: x + " " + y), data["players"]) + +@hook.command +def tf2(pls): + pass