mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
Add beginnings of a reworked ~isitraining
This commit is contained in:
parent
eb7a958352
commit
0a63518b62
23
modules/rain/README.md
Normal file
23
modules/rain/README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## Link
|
||||||
|
|
||||||
|
Retrieves page titles.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
### 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.
|
6
modules/rain/config.json
Normal file
6
modules/rain/config.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"autoTitle": false,
|
||||||
|
"dependencies": [ "command" ],
|
||||||
|
"ignorable": true,
|
||||||
|
"help": "http://github.com/reality/depressionbot/blob/master/modules/link/README.md"
|
||||||
|
}
|
29
modules/rain/rain.js
Normal file
29
modules/rain/rain.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* Module Name: Link
|
||||||
|
* Description: Stores recent channel links, with commands to retrieve
|
||||||
|
* information about links.
|
||||||
|
*/
|
||||||
|
var request = require('request'),
|
||||||
|
_ = require('underscore')._;
|
||||||
|
|
||||||
|
var rain = function(dbot) {
|
||||||
|
var commands = {
|
||||||
|
'~rain': function(event) {
|
||||||
|
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 + "]");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.commands = commands;
|
||||||
|
this.on = 'PRIVMSG';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.fetch = function(dbot) {
|
||||||
|
return new rain(dbot);
|
||||||
|
};
|
38
modules/rain/strings.json
Normal file
38
modules/rain/strings.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"rain-0": {
|
||||||
|
"english" : "It's not raining."
|
||||||
|
},
|
||||||
|
"rain-1": {
|
||||||
|
"english" : "It's raining."
|
||||||
|
},
|
||||||
|
"rain-2": {
|
||||||
|
"english" : "It's raining rather a lot."
|
||||||
|
},
|
||||||
|
"rain-3": {
|
||||||
|
"english" : "It's raining shitloads."
|
||||||
|
},
|
||||||
|
"rain-4": {
|
||||||
|
"english" : "It's raining fucktons."
|
||||||
|
},
|
||||||
|
"rain-5": {
|
||||||
|
"english" : "It's raining whales (in Wales)!"
|
||||||
|
},
|
||||||
|
"rain-6": {
|
||||||
|
"english" : "IT'S SO FUCKING WET OUT HERE MAN"
|
||||||
|
},
|
||||||
|
"rain-7": {
|
||||||
|
"english" : "I AM SO MOIST RIGHT NOW"
|
||||||
|
},
|
||||||
|
"rain-8": {
|
||||||
|
"english" : "You used a #3 pencil instead of #2, didn't you?"
|
||||||
|
},
|
||||||
|
"rain-9": {
|
||||||
|
"english" : "WELCOME TO ATLANTIS"
|
||||||
|
},
|
||||||
|
"rain-10": {
|
||||||
|
"english" : "GET INSIDE"
|
||||||
|
},
|
||||||
|
"rain-11": {
|
||||||
|
"english" : "LOL U PROBABLY DIED"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user