3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 11:42:36 +01:00

Update documentation; contract if statement

This commit is contained in:
Douglas Gardner 2013-01-30 12:21:46 +00:00
parent 0a63518b62
commit 251d69194b
3 changed files with 10 additions and 24 deletions

View File

@ -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.

View File

@ -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"
}

View File

@ -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));
}
};