diff --git a/modules/rain/rain.js b/modules/rain/rain.js index 5af0b5c..ca6a38c 100644 --- a/modules/rain/rain.js +++ b/modules/rain/rain.js @@ -14,14 +14,14 @@ var rain = function(dbot) { request(url, function(error, response, body) { if(response.statusCode == "200") { var data = JSON.parse(body); - var precip = data["precip_1hr_metric"]; + var precip = data["current_observation"]["precip_1hr_metric"]; var score = 2 * Math.pow(precip,0.5); score = Math.ceil(score); if (score > 10) { score = 11; } } else { var score = "e"; } - event.reply(dbot.t("rain-"+score+"[ " + score + " ]")); + event.reply(dbot.t("rain-"+score)); }); } };