Browse Source

add \!batcave-status

Helge Jung 10 years ago
parent
commit
13eae980e2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      modules/ffpb_netstatus.py

+ 7 - 0
modules/ffpb_netstatus.py

@@ -84,6 +84,13 @@ def ffpb_status(bot, trigger):
 
     bot.say('Es sind {0} Knoten und ca. {1} Clients online.'.format(stats["nodes_active"], stats["clients"]))
 
+@willie.module.commands('batcave-status')
+def ffpb_batcave_status(bot, trigger):
+    """State as given by BATCAVE."""
+
+    status = json.loads(urllib2.urlopen('http://[fdca:ffee:ff12:a255::253]:8888/status').read())
+    bot.say('Status: ' + str(json.dumps(status))[1:-1])
+
 @willie.module.commands('highscore')
 def ffpb_highscore(bot, trigger):
     """Print current highscores (nodes + clients)."""