diff --git a/modules/rain/README.md b/modules/rain/README.md index 24c52d0..547a252 100644 --- a/modules/rain/README.md +++ b/modules/rain/README.md @@ -1,23 +1,13 @@ -## Link +## Rain -Retrieves page titles. +Quietly judges your choice of climate. ### Description -This module stores the last posted link in each channel, and provides a command -for retrieving the title of a given link or the last posted link in the channel. +It's a well documented fact that looking out of the window is sometimes far too much effort. However, sometimes you just need toknow how wet it is outside: this module queries for the precipitation level, and tells you when you need a raincoat. -### Configuration - -#### autoTitle: false -If this is set to true, the bot will automatically post the titles of links as -they are posted in the channel. ### Commands -#### ~title [link] -If called with a link, the bot will attempt to find and return the title of that -page. If called without a link, the bot will attempt the same on the last link -which was posted in the current channel. -#### ~ud [headword] -Returns the first [Urban Dictionary](http://www.urbandictionary.com) definition for the headword provided. +#### ~rain +Polls the rainfall in the last hour, and returns an appropriate string. diff --git a/modules/rain/config.json b/modules/rain/config.json index 9c3dc3e..eb3ca8c 100644 --- a/modules/rain/config.json +++ b/modules/rain/config.json @@ -1,6 +1,5 @@ { - "autoTitle": false, "dependencies": [ "command" ], "ignorable": true, - "help": "http://github.com/reality/depressionbot/blob/master/modules/link/README.md" + "help": "http://github.com/reality/depressionbot/blob/master/modules/rain/README.md" } diff --git a/modules/rain/rain.js b/modules/rain/rain.js index 55104d1..81b6feb 100644 --- a/modules/rain/rain.js +++ b/modules/rain/rain.js @@ -1,7 +1,6 @@ /** - * Module Name: Link - * Description: Stores recent channel links, with commands to retrieve - * information about links. + * Module Name: Rain + * Description: Quietly judges your choice of climate. */ var request = require('request'), _ = require('underscore')._; @@ -12,10 +11,8 @@ var rain = function(dbot) { var precip = event.params[1]; var score = 2 * Math.pow(precip,0.5); score = Math.ceil(score); - if (score > 10) e - score = 11; - } - event.reply(dbot.t("rain-"+score) + " [ " + score + "]"); + if (score > 10) { score = 11; } + event.reply(dbot.t("rain-"+score)); } };