fixes and bugsearch

This commit is contained in:
henne 2016-04-30 11:43:35 +02:00
parent 3d195dea48
commit 0f6cca8fbc
2 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "hubot-raumgirl-new", "name": "hubot-raumgirl-new",
"description": "ctdo raumgirl", "description": "ctdo raumgirl",
"version": "0.0.1", "version": "0.0.2",
"author": "henne@ctdo.de", "author": "henne@ctdo.de",
"license": "MIT", "license": "MIT",

View File

@ -38,6 +38,9 @@ module.exports = function(robot) {
robot.hear(/^raumgirl: (rotgruen|gruenrot)$/i, function(r) { robot.hear(/^raumgirl: (rotgruen|gruenrot)$/i, function(r) {
setLampel(1,0,1); setLampel(1,0,1);
}); });
robot.hear(/^raumgirl: (aus|off)$/i, function(r) {
setLampel(0,0,0);
}
// topic // topic
robot.adapter.bot.addListener('topic', function(channel, topic) { robot.adapter.bot.addListener('topic', function(channel, topic) {
if(typeof(robot.brain.data.topics) !== 'Object') { if(typeof(robot.brain.data.topics) !== 'Object') {
@ -102,10 +105,12 @@ module.exports = function(robot) {
}); });
// new stuff // new stuff
robot.respond(/^raumgirl: status$/i, function(r) { robot.respond(/^raumgirl: status$/i, function(r) {
console.log("status");
robot.http("http://status.ctdo.de/api/simple/v2") robot.http("http://status.ctdo.de/api/simple/v2")
.header('Accept', 'application/json') .header('Accept', 'application/json')
.get()(function(err, res, body) { .get()(function(err, res, body) {
var data = JSON.parse(body); var data = JSON.parse(body);
console.log(body);
r.reply("Derzeit im Treff: " + data.names.join(', ')); r.reply("Derzeit im Treff: " + data.names.join(', '));
}) })
}); });